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:
@@ -260,6 +260,8 @@ if !has('nvim')
|
||||
nnoremap <silent><buffer> <S-Tab> ?\[\[<CR>:nohlsearch<CR>
|
||||
nnoremap <silent><buffer> + :call nuwiki#commands#normalize_link()<CR>
|
||||
xnoremap <silent><buffer> + :<C-u>call nuwiki#commands#normalize_link(1)<CR>
|
||||
" Upstream binds visual <CR> to the same normalize-link as visual `+`.
|
||||
xnoremap <silent><buffer> <CR> :<C-u>call nuwiki#commands#normalize_link(1)<CR>
|
||||
exe 'nnoremap <silent><buffer> ' . s:prefix . 'n :call nuwiki#commands#wiki_goto_page('''')<CR>'
|
||||
exe 'nnoremap <silent><buffer> ' . s:prefix . 'd :call nuwiki#commands#delete_file()<CR>'
|
||||
exe 'nnoremap <silent><buffer> ' . s:prefix . 'r :call nuwiki#commands#rename_file()<CR>'
|
||||
@@ -332,6 +334,7 @@ if !has('nvim')
|
||||
inoremap <silent><buffer> <C-L><C-K> <C-o>:call nuwiki#commands#list_cycle_symbol(-1)<CR>
|
||||
inoremap <silent><buffer> <C-L><C-M> <C-o>:call nuwiki#commands#list_toggle_or_add_checkbox()<CR>
|
||||
inoremap <silent><buffer><expr> <CR> nuwiki#commands#smart_return()
|
||||
inoremap <silent><buffer><expr> <S-CR> nuwiki#commands#smart_shift_return()
|
||||
endif
|
||||
|
||||
" Headers
|
||||
|
||||
Reference in New Issue
Block a user