mirror of https://github.com/neovim/neovim.git
Compare commits
3 Commits
7143a8f2ff
...
de795b5b49
Author | SHA1 | Date |
---|---|---|
glepnir | de795b5b49 | |
Maria José Solano | efb44e0cad | |
glepnir | 57f43bd1da |
|
@ -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
|
||||
|
|
|
@ -3632,7 +3632,7 @@ function vim.fn.getregtype(regname) end
|
|||
--- <
|
||||
---
|
||||
--- @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)
|
||||
|
|
|
@ -4475,6 +4475,7 @@ M.funcs = {
|
|||
]=],
|
||||
name = 'getscriptinfo',
|
||||
params = { { 'opts', 'table' } },
|
||||
returns = 'vim.fn.getscriptinfo.ret[]',
|
||||
signature = 'getscriptinfo([{opts}])',
|
||||
},
|
||||
gettabinfo = {
|
||||
|
|
|
@ -800,6 +800,7 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear
|
|||
tl_ret = true;
|
||||
}
|
||||
may_trigger_modechanged();
|
||||
update_screen();
|
||||
|
||||
init_history();
|
||||
s->hiscnt = get_hislen(); // set hiscnt to impossible history value
|
||||
|
|
|
@ -2386,6 +2386,40 @@ describe('highlight namespaces', function()
|
|||
}
|
||||
end)
|
||||
|
||||
it('#update screen when highlight changed in event callback', function ()
|
||||
command('set cursorline number')
|
||||
exec_lua[[
|
||||
vim.api.nvim_create_autocmd('ModeChanged', {
|
||||
callback = function()
|
||||
vim.api.nvim_set_hl(0, 'CursorLineNr', { bg = 'red' })
|
||||
vim.api.nvim_set_hl(0, 'CursorLine', { bg = 'green' })
|
||||
end,
|
||||
})
|
||||
]]
|
||||
feed(':')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
{11: 1 }{12: }|
|
||||
{1:~ }|*8
|
||||
:^ |
|
||||
]],
|
||||
attr_ids = {
|
||||
[1] = { foreground = Screen.colors.Blue, bold = true },
|
||||
[2] = { background = Screen.colors.DarkGrey },
|
||||
[3] = { italic = true, background = Screen.colors.DarkOrange4, foreground = Screen.colors.DarkCyan },
|
||||
[4] = { background = Screen.colors.Magenta4 },
|
||||
[5] = { background = Screen.colors.Magenta4, foreground = Screen.colors.Crimson },
|
||||
[6] = { bold = true, reverse = true },
|
||||
[7] = { reverse = true },
|
||||
[8] = { foreground = Screen.colors.Grey20 },
|
||||
[9] = { foreground = Screen.colors.Blue },
|
||||
[10] = { bold = true, foreground = Screen.colors.SeaGreen },
|
||||
[11] = { background = Screen.colors.Red },
|
||||
[12] = { background = Screen.colors.Green },
|
||||
},
|
||||
})
|
||||
end)
|
||||
|
||||
it('winhl does not accept invalid value #24586', function()
|
||||
local res = exec_lua([[
|
||||
local curwin = vim.api.nvim_get_current_win()
|
||||
|
|
Loading…
Reference in New Issue