feat(parity): close the entire P3 Mappings section

Both remaining mapping gaps (client-side, both clients):

- Visual <CR>: upstream binds it to NormalizeLinkVisualCR (== visual `+`).
  Added `x <CR>` -> normalize_link(true) (wrap the selection as a wikilink)
  in both clients.

- Insert <S-CR>: upstream's multiline-list-item continuation (VimwikiReturn
  2 2 -> kbd_cr with no new marker). New smart_shift_return (both clients,
  <expr> insert mapping): on a list item returns <CR> + spaces aligning under
  the item text (marker width + 1, +4 for a `[ ] ` checkbox), no marker; off a
  list item, a plain <CR>. Mirrors smart_return's auto-indent handling.

Tests: map.visual_cr_wraps_selection + map.insert_shift_cr_multiline
(test-keymaps.lua, the latter exercising the handler directly since <S-CR>
doesn't round-trip headless feedkeys), and map.visual_cr_wraps_selection +
cr.shift_cr_multiline{,_checkbox} (test-keymaps-vim.vim). Docs (README +
doc/nuwiki.txt) and the gap doc updated. Neovim 305, Vim 299/18/21 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 11:04:56 +00:00
parent 305324c6e9
commit 724712121d
9 changed files with 146 additions and 7 deletions
+19 -2
View File
@@ -569,8 +569,20 @@ fix site.
- [ ] `list_ignore_newline` / `text_ignore_newline` — export newline handling.
### Mappings
- [ ] Visual `<CR>` normalize-link (visual `+` covers the same intent).
- [ ] Insert `<S-CR>` multiline list item.
- [x] **Visual `<CR>` normalize-link** _(fixed 2026-06-03)_ — upstream binds
visual `<CR>` to `<Plug>VimwikiNormalizeLinkVisualCR``:VimwikiNormalizeLink 1`,
identical to visual `+`. nuwiki had only visual `+`. _Fix:_ added `x <CR>`
the same wrap-selection handler (`normalize_link(true)`) in both clients
(`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`). Covered by
`map.visual_cr_wraps_selection` in both harnesses.
- [x] **Insert `<S-CR>` multiline list item** _(fixed 2026-06-03)_ — upstream's
insert `<S-CR>` (`VimwikiReturn 2 2``kbd_cr` with no new marker) continues
the current list item on a new line indented to align under the item's text.
_Fix:_ new `smart_shift_return` (both clients, `<expr>` insert mapping): on a
list item returns `<CR>` + (indent +) `marker-width + 1 (+4 for a checkbox)`
spaces — no marker; off a list item, a plain `<CR>`. Mirrors `smart_return`'s
auto-indent handling. Covered by `map.insert_shift_cr_multiline`
(`test-keymaps.lua`) + `cr.shift_cr_multiline{,_checkbox}` (`test-keymaps-vim.vim`).
- [x] **`gLH` / `gLL` / `gLR`** _(fixed 2026-06-03)_ — upstream binds these as
case-variant **aliases** of `gLh` / `gLl` / `gLr` (dedent / indent whole item,
renumber all lists; upstream `ftplugin/vimwiki.vim:553,555,561`). nuwiki had
@@ -713,3 +725,8 @@ audits don't re-flag them.
`use_calendar` opt-out (`g:nuwiki_no_calendar` / setup `use_calendar = false`).
So `use_calendar` is no longer an intentional divergence — removed from that
list above. See `development/calendar-vim-integration.md`.
- Cleared the **entire P3 Mappings section** (2026-06-03): visual `<CR>`
normalize-link (same handler as visual `+`), and insert `<S-CR>` → multiline
list item (`smart_shift_return`, continuation with no new marker aligned under
the text). Both client-side, both clients, tested in both harnesses (Neovim
305, Vim 299/18/21). Only P3 Config items now remain open.