fix(insert): pumvisible() guard on smart_return/smart_shift_return (audit follow-up)
The mappings re-audit confirmed the two new bindings (visual <CR> normalize, insert <S-CR> multiline item) are correct — column math matches upstream's s:text_begin, auto-indent handling sound, no parity gaps or regressions. It flagged one low-severity item shared with the pre-existing smart_return: neither guarded the completion popup. Upstream maps <CR>/<S-CR> as `pumvisible() ? '<CR>' : …`. Added that guard to both smart_return and smart_shift_return (both clients) so a <CR>/<S-CR> accepts the completion instead of continuing the list when the popup is open. Left as a documented minor divergence: <S-CR> on an *empty* bullet emits the aligned no-marker continuation rather than upstream's "blank line above, keep marker" (niche). Neovim 305, Vim 299/18/21 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -581,8 +581,14 @@ fix site.
|
||||
_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`).
|
||||
auto-indent handling (column math verified against upstream's `s:text_begin`).
|
||||
Both `smart_return` and `smart_shift_return` also gained upstream's
|
||||
`pumvisible()` guard (return a plain `<CR>` to accept a completion). _Minor
|
||||
divergence:_ `<S-CR>` on an *empty* bullet emits the aligned no-marker
|
||||
continuation rather than upstream's "blank line above, keep the marker" — a
|
||||
niche case; the common non-empty continuation is exact. 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
|
||||
|
||||
Reference in New Issue
Block a user