mirror of
https://github.com/neovim/neovim.git
synced 2025-12-11 09:02:40 +00:00
fix(pack): rename confirmation buffer to again use nvim-pack:// scheme
Problem: `nvim://` scheme feels more like a generalized interface that may be requested externally, and it acts like CLI args (roughly). This is how `vscode://` works. Anything that behaves like an "app" or a "protocol" deserves its own scheme. For such Nvim-owned things they will be called `nvim-xx://`. Solution: Use `nvim-pack://confirm#<bufnr>` template for confirmation buffer name instead of `nvim://pack-confirm#<bufnr>`.
This commit is contained in:
@@ -283,7 +283,7 @@ mappings to a specific action by invoking `vim.lsp.buf.code_action()` with the
|
||||
|
||||
Example: See `runtime/lua/vim/pack/_lsp.lua` for how vim.pack defines an
|
||||
in-process LSP server to provide interactive features in its
|
||||
`nvim://pack-confirm` buffer.
|
||||
`nvim-pack://confirm` buffer.
|
||||
|
||||
==============================================================================
|
||||
Troubleshooting *lua-plugin-troubleshooting*
|
||||
|
||||
@@ -1057,7 +1057,7 @@ end
|
||||
local function show_confirm_buf(lines, on_finish)
|
||||
-- Show buffer in a separate tabpage
|
||||
local bufnr = api.nvim_create_buf(true, true)
|
||||
api.nvim_buf_set_name(bufnr, 'nvim://pack-confirm#' .. bufnr)
|
||||
api.nvim_buf_set_name(bufnr, 'nvim-pack://confirm#' .. bufnr)
|
||||
api.nvim_buf_set_lines(bufnr, 0, -1, false, lines)
|
||||
vim.cmd.sbuffer({ bufnr, mods = { tab = vim.fn.tabpagenr() } })
|
||||
local tab_id = api.nvim_get_current_tabpage()
|
||||
|
||||
@@ -20,7 +20,7 @@ function methods.shutdown(_, callback)
|
||||
end
|
||||
|
||||
local get_confirm_bufnr = function(uri)
|
||||
return tonumber(uri:match('^nvim://pack%-confirm#(%d+)$'))
|
||||
return tonumber(uri:match('^nvim%-pack://confirm#(%d+)$'))
|
||||
end
|
||||
|
||||
local group_header_pattern = '^# (%S+)'
|
||||
|
||||
Reference in New Issue
Block a user