fix(pack): use more correct URI for confirmation buffer name

Problem: Confirmation buffer is named with `nvim-pack://` as scheme
  prefix and uses buffer id (needed for in-process LSP) as one an entry
  in the "hierarchical part".

Solution: Use `nvim://pack-confirm#<buf>` format with a more ubiquitous
  `nvim://` prefix and buffer id at the end as the optional fragment.
This commit is contained in:
Evgeni Chasnovski
2025-11-06 20:13:17 +02:00
parent ee3239fcb6
commit eff01b7620
4 changed files with 7 additions and 7 deletions

View File

@@ -987,7 +987,7 @@ describe('vim.pack', function()
local confirm_bufnr = api.nvim_get_current_buf()
local confirm_winnr = api.nvim_get_current_win()
local confirm_tabpage = api.nvim_get_current_tabpage()
eq(api.nvim_buf_get_name(0), 'nvim-pack://' .. confirm_bufnr .. '/confirm-update')
eq(api.nvim_buf_get_name(0), 'nvim://pack-confirm#' .. confirm_bufnr)
-- Adjust lines for a more robust screenshot testing
local fetch_src = repos_src.fetch
@@ -1037,10 +1037,10 @@ describe('vim.pack', function()
short_hashes.fetch_new_prev = git_get_short_hash('main~', 'fetch')
hashes.semver_head = git_get_hash('v0.3.0', 'semver')
local tab_name = 'n' .. (t.is_os('win') and ':' or '') .. '//2/confirm-update'
local tab_name = 'n' .. (t.is_os('win') and ':' or '') .. '//pack-confirm#2'
local screen_lines = {
('{24: [No Name] }{5: %s }{2:%s }{24:X}|'):format(
('{24: [No Name] }{5: %s }{2:%s }{24:X}|'):format(
tab_name,
t.is_os('win') and '' or ' '
),