mirror of https://github.com/neovim/neovim.git
Compare commits
4 Commits
b7b4cd771f
...
b13709c5e2
Author | SHA1 | Date |
---|---|---|
glepnir | b13709c5e2 | |
Maria José Solano | efb44e0cad | |
zeertzjq | e948d7feba | |
glepnir | 24131b443f |
|
@ -3014,7 +3014,7 @@ getscriptinfo([{opts}]) *getscriptinfo()*
|
|||
|
||||
Examples: >vim
|
||||
echo getscriptinfo({'name': 'myscript'})
|
||||
echo getscriptinfo({'sid': 15}).variables
|
||||
echo getscriptinfo({'sid': 15})[0].variables
|
||||
<
|
||||
|
||||
gettabinfo([{tabnr}]) *gettabinfo()*
|
||||
|
|
|
@ -124,7 +124,7 @@ error('Cannot require a meta file')
|
|||
--- @field commalist boolean
|
||||
--- @field flaglist boolean
|
||||
--- @field was_set boolean
|
||||
--- @field last_set_id integer
|
||||
--- @field last_set_sid integer
|
||||
--- @field last_set_linenr integer
|
||||
--- @field last_set_chan integer
|
||||
--- @field type 'string'|'boolean'|'number'
|
||||
|
|
|
@ -127,3 +127,11 @@
|
|||
--- @field skipcol integer
|
||||
--- @field topfill integer
|
||||
--- @field topline integer
|
||||
|
||||
--- @class vim.fn.getscriptinfo.ret
|
||||
--- @field autoload false
|
||||
--- @field functions? string[]
|
||||
--- @field name string
|
||||
--- @field sid string
|
||||
--- @field variables? table<string, any>
|
||||
--- @field version 1
|
||||
|
|
|
@ -3628,11 +3628,11 @@ function vim.fn.getregtype(regname) end
|
|||
---
|
||||
--- Examples: >vim
|
||||
--- echo getscriptinfo({'name': 'myscript'})
|
||||
--- echo getscriptinfo({'sid': 15}).variables
|
||||
--- echo getscriptinfo({'sid': 15})[0].variables
|
||||
--- <
|
||||
---
|
||||
--- @param opts? table
|
||||
--- @return any
|
||||
--- @return vim.fn.getscriptinfo.ret[]
|
||||
function vim.fn.getscriptinfo(opts) end
|
||||
|
||||
--- If {tabnr} is not specified, then information about all the
|
||||
|
|
|
@ -310,6 +310,7 @@ local function is_empty_or_default(bufnr, option)
|
|||
end
|
||||
|
||||
local info = api.nvim_get_option_info2(option, { buf = bufnr })
|
||||
---@param e vim.fn.getscriptinfo.ret
|
||||
local scriptinfo = vim.tbl_filter(function(e)
|
||||
return e.sid == info.last_set_sid
|
||||
end, vim.fn.getscriptinfo())
|
||||
|
@ -515,7 +516,7 @@ local function buf_attach(bufnr)
|
|||
textDocument = {
|
||||
uri = uri,
|
||||
},
|
||||
reason = protocol.TextDocumentSaveReason.Manual,
|
||||
reason = protocol.TextDocumentSaveReason.Manual, ---@type integer
|
||||
}
|
||||
if vim.tbl_get(client.server_capabilities, 'textDocumentSync', 'willSave') then
|
||||
client.notify(ms.textDocument_willSave, params)
|
||||
|
@ -899,7 +900,7 @@ end
|
|||
--- a `client_id:result` map.
|
||||
---@return function cancel Function that cancels all requests.
|
||||
function lsp.buf_request_all(bufnr, method, params, handler)
|
||||
local results = {} --- @type table<integer,{error:string, result:any}>
|
||||
local results = {} --- @type table<integer,{error:lsp.ResponseError, result:any}>
|
||||
local result_count = 0
|
||||
local expected_result_count = 0
|
||||
|
||||
|
@ -940,7 +941,7 @@ end
|
|||
---@return table<integer, {err: lsp.ResponseError, result: any}>? result Map of client_id:request_result.
|
||||
---@return string? err On timeout, cancel, or error, `err` is a string describing the failure reason, and `result` is nil.
|
||||
function lsp.buf_request_sync(bufnr, method, params, timeout_ms)
|
||||
local request_results
|
||||
local request_results ---@type table
|
||||
|
||||
local cancel = lsp.buf_request_all(bufnr, method, params, function(it)
|
||||
request_results = it
|
||||
|
|
|
@ -327,7 +327,7 @@ function M.get_captures_at_cursor(winnr)
|
|||
end
|
||||
|
||||
--- Optional keyword arguments:
|
||||
--- @class vim.treesitter.get_node.Opts
|
||||
--- @class vim.treesitter.get_node.Opts : vim.treesitter.LanguageTree.tree_for_range.Opts
|
||||
--- @inlinedoc
|
||||
---
|
||||
--- Buffer number (nil or 0 for current buffer)
|
||||
|
|
|
@ -4470,11 +4470,12 @@ M.funcs = {
|
|||
|
||||
Examples: >vim
|
||||
echo getscriptinfo({'name': 'myscript'})
|
||||
echo getscriptinfo({'sid': 15}).variables
|
||||
echo getscriptinfo({'sid': 15})[0].variables
|
||||
<
|
||||
]=],
|
||||
name = 'getscriptinfo',
|
||||
params = { { 'opts', 'table' } },
|
||||
returns = 'vim.fn.getscriptinfo.ret[]',
|
||||
signature = 'getscriptinfo([{opts}])',
|
||||
},
|
||||
gettabinfo = {
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "nvim/grid.h"
|
||||
#include "nvim/highlight.h"
|
||||
#include "nvim/highlight_defs.h"
|
||||
#include "nvim/highlight_group.h"
|
||||
#include "nvim/indent.h"
|
||||
#include "nvim/input.h"
|
||||
#include "nvim/keycodes.h"
|
||||
|
@ -1434,6 +1435,10 @@ void msg_start(void)
|
|||
need_fileinfo = false;
|
||||
}
|
||||
|
||||
if (need_highlight_changed) {
|
||||
highlight_changed();
|
||||
}
|
||||
|
||||
if (need_clr_eos || (p_ch == 0 && redrawing_cmdline)) {
|
||||
// Halfway an ":echo" command and getting an (error) message: clear
|
||||
// any text from the command.
|
||||
|
|
|
@ -181,12 +181,15 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
-- Also check for real cursor position, as it is used for stuff like input methods
|
||||
screen._handle_busy_start = function() end
|
||||
screen._handle_busy_stop = function() end
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
end
|
||||
|
||||
before_each(clear)
|
||||
|
@ -198,58 +201,76 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
|
||||
it('at the end', function()
|
||||
feed('<C-R>r')
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaaaa{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaaaa{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 9 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaaa^a{4: } |
|
||||
|
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaaa^a{4: } |
|
||||
|
|
||||
]]
|
||||
})
|
||||
eq({ 6, 8 }, eval('nvim_win_get_cursor(0)'))
|
||||
end)
|
||||
|
||||
it('near the end', function()
|
||||
feed('<C-R>r<C-X><C-X>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaa{2:^a}a |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaa{2:^a}a |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 7 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaa^a{4:a}a |
|
||||
|
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaa^a{4:a}a |
|
||||
|
|
||||
]]
|
||||
})
|
||||
eq({ 6, 6 }, eval('nvim_win_get_cursor(0)'))
|
||||
end)
|
||||
|
||||
it('near the start', function()
|
||||
feed('<C-R>r<C-B><C-O>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:a{2:^a}aaaaaa |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:a{2:^a}aaaaaa |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 2 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:^a{4:a}aaaaaa |
|
||||
|
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:^a{4:a}aaaaaa |
|
||||
|
|
||||
]]
|
||||
})
|
||||
eq({ 6, 1 }, eval('nvim_win_get_cursor(0)'))
|
||||
end)
|
||||
end)
|
||||
|
@ -261,46 +282,59 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
|
||||
it('at the end', function()
|
||||
feed('<C-R>r')
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµµµµ{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµµµµ{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 17 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµµµ^µ{4: } |
|
||||
|
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµµµ^µ{4: } |
|
||||
|
|
||||
]]
|
||||
})
|
||||
eq({ 6, 15 }, eval('nvim_win_get_cursor(0)'))
|
||||
end)
|
||||
|
||||
it('near the end', function()
|
||||
feed('<C-R>r<C-X><C-X>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµµ{2:^µ}µ |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµµ{2:^µ}µ |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 13 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµ^µ{4:µ}µ |
|
||||
|
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µµµµµ^µ{4:µ}µ |
|
||||
|
|
||||
]]
|
||||
})
|
||||
eq({ 6, 11 }, eval('nvim_win_get_cursor(0)'))
|
||||
end)
|
||||
|
||||
it('near the start', function()
|
||||
feed('<C-R>r<C-B><C-O>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µ{2:^µ}µµµµµµ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -308,7 +342,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 3 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:^µ{4:µ}µµµµµµ |
|
||||
|
|
||||
|
@ -325,7 +360,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
it('at the end', function()
|
||||
feed('<C-R>r')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -333,7 +369,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 33 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{4: } |
|
||||
|
|
||||
|
@ -345,7 +382,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
skip(is_os('win'))
|
||||
feed('<C-R>r<C-X><C-X>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µ̳µ̳µ̳µ̳µ̳µ̳{2:^µ̳}µ̳ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -353,7 +391,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µ̳µ̳µ̳µ̳µ̳^µ̳{4:µ̳}µ̳ |
|
||||
|
|
||||
|
@ -365,7 +404,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
skip(is_os('win'))
|
||||
feed('<C-R>r<C-B><C-O>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:µ̳{2:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -373,7 +413,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 5 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:^µ̳{4:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||
|
|
||||
|
@ -390,7 +431,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
it('at the end', function()
|
||||
feed('<C-R>r')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:哦哦哦哦哦哦哦哦{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -398,7 +440,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 25 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:哦哦哦哦哦哦哦^哦{4: } |
|
||||
|
|
||||
|
@ -409,7 +452,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
it('near the end', function()
|
||||
feed('<C-R>r<C-X><C-X>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:哦哦哦哦哦哦{2:^哦}哦 |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -417,7 +461,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 19 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:哦哦哦哦哦^哦{4:哦}哦 |
|
||||
|
|
||||
|
@ -428,7 +473,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
it('near the start', function()
|
||||
feed('<C-R>r<C-B><C-O>')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:哦{2:^哦}哦哦哦哦哦哦 |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -436,7 +482,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 4 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:^哦{4:哦}哦哦哦哦哦哦 |
|
||||
|
|
||||
|
@ -449,7 +496,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
setup_ex_register('aaaaaaaa ')
|
||||
feed('<C-R>r')
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaaaa {2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -458,7 +506,8 @@ describe('buffer cursor position is correct in terminal without number column',
|
|||
eq({ 6, 13 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
|*4
|
||||
|*3
|
||||
{2: }|
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
:aaaaaaaa ^ {4: } |
|
||||
|
|
||||
|
@ -499,15 +548,17 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
-- Also check for real cursor position, as it is used for stuff like input methods
|
||||
screen._handle_busy_start = function() end
|
||||
screen._handle_busy_stop = function() end
|
||||
screen:expect([[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
end
|
||||
|
||||
before_each(function()
|
||||
|
@ -522,47 +573,53 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
|
||||
it('at the end', function()
|
||||
feed('<C-R>r')
|
||||
screen:expect([[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaaaa{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaaaa{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 9 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaaa^a{4: } |
|
||||
|
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaaa^a{4: } |
|
||||
|
|
||||
]]
|
||||
})
|
||||
eq({ 6, 8 }, eval('nvim_win_get_cursor(0)'))
|
||||
end)
|
||||
|
||||
it('near the end', function()
|
||||
feed('<C-R>r<C-X><C-X>')
|
||||
screen:expect([[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaa{2:^a}a |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaa{2:^a}a |
|
||||
{3:-- TERMINAL --} |
|
||||
]]
|
||||
})
|
||||
eq({ 6, 7 }, eval('nvim_win_get_cursor(0)'))
|
||||
feed([[<C-\><C-N>]])
|
||||
screen:expect([[
|
||||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaa^a{4:a}a |
|
||||
|
|
||||
|
@ -576,7 +633,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:a{2:^a}aaaaaa |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -587,7 +644,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:^a{4:a}aaaaaa |
|
||||
|
|
||||
|
@ -607,7 +664,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µµµµµµµµ{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -618,7 +675,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µµµµµµµ^µ{4: } |
|
||||
|
|
||||
|
@ -632,7 +689,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µµµµµµ{2:^µ}µ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -643,7 +700,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µµµµµ^µ{4:µ}µ |
|
||||
|
|
||||
|
@ -657,7 +714,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µ{2:^µ}µµµµµµ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -668,7 +725,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:^µ{4:µ}µµµµµµ |
|
||||
|
|
||||
|
@ -688,7 +745,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -699,7 +756,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{4: } |
|
||||
|
|
||||
|
@ -714,7 +771,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳{2:^µ̳}µ̳ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -725,7 +782,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µ̳µ̳µ̳µ̳µ̳^µ̳{4:µ̳}µ̳ |
|
||||
|
|
||||
|
@ -740,7 +797,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:µ̳{2:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -751,7 +808,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:^µ̳{4:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ |
|
||||
|
|
||||
|
@ -771,7 +828,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:哦哦哦哦哦哦哦哦{2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -782,7 +839,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:哦哦哦哦哦哦哦^哦{4: } |
|
||||
|
|
||||
|
@ -796,7 +853,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:哦哦哦哦哦哦{2:^哦}哦 |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -807,7 +864,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:哦哦哦哦哦^哦{4:哦}哦 |
|
||||
|
|
||||
|
@ -821,7 +878,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:哦{2:^哦}哦哦哦哦哦哦 |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -832,7 +889,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:^哦{4:哦}哦哦哦哦哦哦 |
|
||||
|
|
||||
|
@ -848,7 +905,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaaaa {2:^ } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
@ -860,7 +917,7 @@ describe('buffer cursor position is correct in terminal with number column', fun
|
|||
{7: 1 } |
|
||||
{7: 2 } |
|
||||
{7: 3 } |
|
||||
{7: 4 } |
|
||||
{7: 4 }{2: }|
|
||||
{7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{7: 6 }:aaaaaaaa ^ {4: } |
|
||||
|
|
||||
|
|
|
@ -41,13 +41,16 @@ local function test_embed(ext_linegrid)
|
|||
|
||||
it('can display errors', function()
|
||||
startup('--cmd', 'echoerr invalid+')
|
||||
screen:expect([[
|
||||
|*4
|
||||
{6: }|
|
||||
{7:Error detected while processing pre-vimrc command line:} |
|
||||
{7:E121: Undefined variable: invalid} |
|
||||
{8:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*4
|
||||
{5: }|
|
||||
{7:Error detected while processing pre-vimrc command line:} |
|
||||
{7:E121: Undefined variable: invalid} |
|
||||
{2:Press ENTER or type command to continue}^ |
|
||||
]],
|
||||
})
|
||||
|
||||
feed('<cr>')
|
||||
screen:expect([[
|
||||
|
@ -62,14 +65,16 @@ local function test_embed(ext_linegrid)
|
|||
pending('FIXME #10804')
|
||||
end
|
||||
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
|
||||
screen:expect([[
|
||||
|*3
|
||||
{6: }|
|
||||
{7:Error detected while processing pre-vimrc command line:} |
|
||||
{7:foo} |
|
||||
{7:bar} |
|
||||
{8:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
|*3
|
||||
{6: }|
|
||||
{7:Error detected while processing pre-vimrc command line:} |
|
||||
{7:foo} |
|
||||
{7:bar} |
|
||||
{8:Press ENTER or type command to continue}^ |
|
||||
]],
|
||||
})
|
||||
end)
|
||||
|
||||
it("doesn't erase output when setting Normal colors", function()
|
||||
|
@ -77,11 +82,11 @@ local function test_embed(ext_linegrid)
|
|||
screen:expect {
|
||||
grid = [[
|
||||
|*3
|
||||
{6: }|
|
||||
{5: }|
|
||||
{7:Error detected while processing pre-vimrc command line:} |
|
||||
{7:foo} |
|
||||
{7:bar} |
|
||||
{8:Press ENTER or type command to continue}^ |
|
||||
{1:bar} |
|
||||
{2:Press ENTER or type command to continue}^ |
|
||||
]],
|
||||
condition = function()
|
||||
eq(Screen.colors.Green, screen.default_colors.rgb_bg)
|
||||
|
|
|
@ -2529,4 +2529,18 @@ describe('fg/bg special colors', function()
|
|||
eq(new_guifg, eval('synIDattr(hlID("Visual"), "bg#")'))
|
||||
eq(new_guibg, eval('synIDattr(hlID("Visual"), "sp#")'))
|
||||
end)
|
||||
|
||||
it('refresh cmdline after MsgArea set #17832', function()
|
||||
screen:attach({ rgb = true })
|
||||
command('set termguicolors')
|
||||
command('call nvim_set_hl(0, "MsgArea", {"fg": "Red"})')
|
||||
command('echomsg "foo"')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*5
|
||||
{19:foo }|
|
||||
]],
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue