fix(keymaps): correct Neovim global diary tab/tomorrow maps (map_prefix audit)
A map_prefix parity audit against upstream vimwiki found the Neovim global entry-point block in lua/nuwiki/init.lua carried the same collision the Vim global + buffer-local maps were already fixed for: <prefix><Leader>t was bound to tomorrow and <prefix><Leader>m (tomorrow) was missing entirely. Now <prefix><Leader>t opens today in a new tab and <prefix><Leader>m is tomorrow — consistent with plugin/nuwiki.vim, the buffer-local maps, and upstream (VimwikiTabMakeDiaryNote / VimwikiMakeTomorrowDiaryNote). Adds global_maps.diary_tab_and_tomorrow_targets to test-keymaps.lua (queries in a scratch buffer so buffer-local maps don't shadow the globals). Logs the fix plus a new "RSS feed structure fidelity" gap (the audit confirmed the custom_wiki2html arg contract and base_url scope are faithful; only the RSS document shape diverges) in development/vimwiki-gap.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -850,6 +850,33 @@ vim.defer_fn(function()
|
||||
if not ok then error(err) end
|
||||
end)
|
||||
|
||||
-- ===== Global (non-buffer) entry-point diary maps =====
|
||||
-- init.lua _setup_global_mappings ran during setup(). Regression guard for
|
||||
-- the audit-found bug: <prefix><Leader>t must be today-in-a-tab and
|
||||
-- <prefix><Leader>m must be tomorrow (matching the Vim global side +
|
||||
-- upstream), not the old wiring that dropped `m` and bound `t` to tomorrow.
|
||||
-- Query in a scratch (non-vimwiki) buffer so the buffer-local maps don't
|
||||
-- shadow the globals.
|
||||
tobj_case('global_maps.diary_tab_and_tomorrow_targets', function()
|
||||
local buf = vim.api.nvim_create_buf(false, true)
|
||||
vim.api.nvim_set_current_buf(buf)
|
||||
local function gdesc(lhs)
|
||||
local d = vim.fn.maparg(lhs, 'n', false, true)
|
||||
if vim.tbl_isempty(d) then return nil end
|
||||
return d.desc or ''
|
||||
end
|
||||
local ok, err = pcall(function()
|
||||
local t = gdesc('<Leader>w<Leader>t')
|
||||
local m = gdesc('<Leader>w<Leader>m')
|
||||
if not t then error('<Leader>w<Leader>t global map missing') end
|
||||
if not m then error('<Leader>w<Leader>m global map missing (tomorrow)') end
|
||||
if not t:find('tab') then error('<Leader>w<Leader>t should be today-in-tab, desc=' .. t) end
|
||||
if not m:find('tomorrow') then error('<Leader>w<Leader>m should be tomorrow, desc=' .. m) end
|
||||
end)
|
||||
vim.api.nvim_buf_delete(buf, { force = true })
|
||||
if not ok then error(err) end
|
||||
end)
|
||||
|
||||
-- ===== Wiki picker (config-driven, no LSP) =====
|
||||
-- The picker must build its list from config so it works from any buffer
|
||||
-- before the server attaches.
|
||||
|
||||
Reference in New Issue
Block a user