mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix: use nvim namespace convention #34010
This commit is contained in:

committed by
GitHub

parent
fed9069b8d
commit
62ba6e8a76
@@ -742,7 +742,7 @@ local registered_autocmds = {}
|
|||||||
|
|
||||||
local function make_augroup_key(namespace, bufnr)
|
local function make_augroup_key(namespace, bufnr)
|
||||||
local ns = M.get_namespace(namespace)
|
local ns = M.get_namespace(namespace)
|
||||||
return string.format('DiagnosticInsertLeave:%s:%s', bufnr, ns.name)
|
return string.format('nvim.diagnostic.insertleave.%s.%s', bufnr, ns.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param namespace integer
|
--- @param namespace integer
|
||||||
|
@@ -189,7 +189,7 @@ function M.get_namespace(client_id, is_pull)
|
|||||||
vim.tbl_get((client or {}).server_capabilities, 'diagnosticProvider', 'identifier')
|
vim.tbl_get((client or {}).server_capabilities, 'diagnosticProvider', 'identifier')
|
||||||
local key = string.format('%d:%s', client_id, server_id or 'nil')
|
local key = string.format('%d:%s', client_id, server_id or 'nil')
|
||||||
local name = string.format(
|
local name = string.format(
|
||||||
'vim.lsp.%s.%d.%s',
|
'nvim.lsp.%s.%d.%s',
|
||||||
client and client.name or 'unknown',
|
client and client.name or 'unknown',
|
||||||
client_id,
|
client_id,
|
||||||
server_id or 'nil'
|
server_id or 'nil'
|
||||||
@@ -201,7 +201,7 @@ function M.get_namespace(client_id, is_pull)
|
|||||||
end
|
end
|
||||||
return ns
|
return ns
|
||||||
else
|
else
|
||||||
local name = string.format('vim.lsp.%s.%d', client and client.name or 'unknown', client_id)
|
local name = string.format('nvim.lsp.%s.%d', client and client.name or 'unknown', client_id)
|
||||||
local ns = _client_push_namespaces[client_id]
|
local ns = _client_push_namespaces[client_id]
|
||||||
if not ns then
|
if not ns then
|
||||||
ns = api.nvim_create_namespace(name)
|
ns = api.nvim_create_namespace(name)
|
||||||
|
@@ -3,7 +3,7 @@ if exists('g:loaded_shada_plugin')
|
|||||||
endif
|
endif
|
||||||
let g:loaded_shada_plugin = 1
|
let g:loaded_shada_plugin = 1
|
||||||
|
|
||||||
augroup ShaDaCommands
|
augroup nvim.shada
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufReadCmd *.shada,*.shada.tmp.[a-z]
|
autocmd BufReadCmd *.shada,*.shada.tmp.[a-z]
|
||||||
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
|
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
|
||||||
|
@@ -2636,8 +2636,7 @@ describe('plugin/shada.vim', function()
|
|||||||
wshada('\004\000\009\147\000\196\002ab\196\001a')
|
wshada('\004\000\009\147\000\196\002ab\196\001a')
|
||||||
wshada_tmp('\004\000\009\147\000\196\002ab\196\001b')
|
wshada_tmp('\004\000\009\147\000\196\002ab\196\001b')
|
||||||
|
|
||||||
local bufread_commands =
|
local bufread_commands = api.nvim_get_autocmds({ group = 'nvim.shada', event = 'BufReadCmd' })
|
||||||
api.nvim_get_autocmds({ group = 'ShaDaCommands', event = 'BufReadCmd' })
|
|
||||||
eq(2, #bufread_commands--[[, vim.inspect(bufread_commands) ]])
|
eq(2, #bufread_commands--[[, vim.inspect(bufread_commands) ]])
|
||||||
|
|
||||||
-- Need to set nohidden so that the buffer containing 'fname' is not unloaded
|
-- Need to set nohidden so that the buffer containing 'fname' is not unloaded
|
||||||
|
Reference in New Issue
Block a user