Fix glp backward cycle and gl<Space> current-list scope
CI / cargo fmt --check (push) Successful in 16s
CI / cargo clippy (push) Successful in 21s
CI / cargo test (push) Successful in 37s
CI / cargo fmt --check (pull_request) Successful in 34s
CI / cargo clippy (pull_request) Successful in 36s
CI / cargo test (pull_request) Successful in 38s
CI / editor keymaps (push) Successful in 1m23s
CI / editor keymaps (pull_request) Successful in 1m31s
CI / cargo fmt --check (push) Successful in 16s
CI / cargo clippy (push) Successful in 21s
CI / cargo test (push) Successful in 37s
CI / cargo fmt --check (pull_request) Successful in 34s
CI / cargo clippy (pull_request) Successful in 36s
CI / cargo test (pull_request) Successful in 38s
CI / editor keymaps (push) Successful in 1m23s
CI / editor keymaps (pull_request) Successful in 1m31s
Two documented checkbox-list mappings did not match their spec: - `glp` dispatched the same forward-only cycleCheckbox as `gln`, so it could never "cycle the checkbox state backward". Add `ops::cycle_state_back` and thread a `reverse` flag through the dispatcher and both clients. - `gl<Space>` and `gL<Space>` both swept the whole buffer, making them identical. `gl<Space>` now passes the cursor position and the server scopes deletion to the contiguous list block under the cursor (current list, cascading into sublists); `gL<Space>` stays whole-buffer. Adds Rust unit tests, plus behavioral and full-registration coverage for the documented mapping surface in the Neovim and Vim keymap harnesses, and a command-coverage suite mirroring the doc's command groups. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+32
-3
@@ -115,6 +115,21 @@ if !has('nvim')
|
||||
command! -buffer -nargs=? NuwikiGenerateTagLinks call nuwiki#commands#tags_generate_links(<q-args>)
|
||||
command! -buffer -nargs=1 NuwikiGoto call nuwiki#commands#wiki_goto_page(<q-args>)
|
||||
|
||||
" Canonical :Nuwiki* names that mirror the documented surface (doc §5).
|
||||
" The older :Nuwiki* spellings above stay defined for back-compat.
|
||||
command! -buffer NuwikiNextLink call nuwiki#commands#link_next()
|
||||
command! -buffer NuwikiPrevLink call nuwiki#commands#link_prev()
|
||||
command! -buffer NuwikiBaddLink call nuwiki#commands#badd_link()
|
||||
command! -buffer NuwikiMakeDiaryNote call nuwiki#commands#diary_today()
|
||||
command! -buffer NuwikiMakeYesterdayDiaryNote call nuwiki#commands#diary_yesterday()
|
||||
command! -buffer NuwikiMakeTomorrowDiaryNote call nuwiki#commands#diary_tomorrow()
|
||||
command! -buffer NuwikiDiaryGenerateLinks call nuwiki#commands#diary_generate_index()
|
||||
command! -buffer NuwikiDiaryNextDay call nuwiki#commands#diary_next()
|
||||
command! -buffer NuwikiDiaryPrevDay call nuwiki#commands#diary_prev()
|
||||
command! -buffer Nuwiki2HTML call nuwiki#commands#export_current()
|
||||
command! -buffer Nuwiki2HTMLBrowse call nuwiki#commands#export_browse()
|
||||
command! -buffer -bang NuwikiAll2HTML if <bang>0 | call nuwiki#commands#export_all_force() | else | call nuwiki#commands#export_all() | endif
|
||||
|
||||
" ===== Default key mappings (parity with upstream vimwiki) =====
|
||||
"
|
||||
" Users can opt out by setting `g:nuwiki_no_default_mappings = 1`
|
||||
@@ -162,8 +177,8 @@ if !has('nvim')
|
||||
nnoremap <silent><buffer> gnt :call nuwiki#commands#next_task()<CR>
|
||||
nnoremap <silent><buffer> gln :call nuwiki#commands#cycle_list_item()<CR>
|
||||
xnoremap <silent><buffer> gln :<C-u>call nuwiki#commands#cycle_list_item()<CR>
|
||||
nnoremap <silent><buffer> glp :call nuwiki#commands#cycle_list_item()<CR>
|
||||
xnoremap <silent><buffer> glp :<C-u>call nuwiki#commands#cycle_list_item()<CR>
|
||||
nnoremap <silent><buffer> glp :call nuwiki#commands#cycle_list_item_back()<CR>
|
||||
xnoremap <silent><buffer> glp :<C-u>call nuwiki#commands#cycle_list_item_back()<CR>
|
||||
nnoremap <silent><buffer> glx :call nuwiki#commands#reject_list_item()<CR>
|
||||
xnoremap <silent><buffer> glx :<C-u>call nuwiki#commands#reject_list_item()<CR>
|
||||
nnoremap <silent><buffer> glh :call nuwiki#commands#list_change_level(-1, 0)<CR>
|
||||
@@ -173,7 +188,7 @@ if !has('nvim')
|
||||
nnoremap <silent><buffer> glr :call nuwiki#commands#list_renumber()<CR>
|
||||
nnoremap <silent><buffer> gLr :call nuwiki#commands#list_renumber_all()<CR>
|
||||
nnoremap <silent><buffer> gl<Space> :call nuwiki#commands#list_remove_done()<CR>
|
||||
nnoremap <silent><buffer> gL<Space> :call nuwiki#commands#list_remove_done()<CR>
|
||||
nnoremap <silent><buffer> gL<Space> :call nuwiki#commands#list_remove_done_all()<CR>
|
||||
nnoremap <silent><buffer> o :call nuwiki#commands#open_below_with_bullet()<CR>
|
||||
nnoremap <silent><buffer> O :call nuwiki#commands#open_above_with_bullet()<CR>
|
||||
|
||||
@@ -355,5 +370,19 @@ command! -buffer -nargs=? NuwikiSearchTags lua require('nuwiki.commands'
|
||||
command! -buffer -nargs=? NuwikiGenerateTagLinks lua require('nuwiki.commands').tags_generate_links(<q-args>)
|
||||
command! -buffer -nargs=1 NuwikiGoto lua require('nuwiki.commands').wiki_goto_page(<q-args>)
|
||||
|
||||
" Canonical :Nuwiki* names that mirror the documented surface (doc §5).
|
||||
" The older :Nuwiki* spellings above stay defined for back-compat.
|
||||
command! -buffer NuwikiNextLink lua require('nuwiki.commands').link_next()
|
||||
command! -buffer NuwikiPrevLink lua require('nuwiki.commands').link_prev()
|
||||
command! -buffer NuwikiBaddLink lua require('nuwiki.commands').badd_link()
|
||||
command! -buffer NuwikiMakeDiaryNote lua require('nuwiki.commands').diary_today()
|
||||
command! -buffer NuwikiMakeYesterdayDiaryNote lua require('nuwiki.commands').diary_yesterday()
|
||||
command! -buffer NuwikiMakeTomorrowDiaryNote lua require('nuwiki.commands').diary_tomorrow()
|
||||
command! -buffer NuwikiDiaryNextDay lua require('nuwiki.commands').diary_next()
|
||||
command! -buffer NuwikiDiaryPrevDay lua require('nuwiki.commands').diary_prev()
|
||||
command! -buffer Nuwiki2HTML lua require('nuwiki.commands').export_current()
|
||||
command! -buffer Nuwiki2HTMLBrowse lua require('nuwiki.commands').export_browse()
|
||||
command! -buffer -bang NuwikiAll2HTML execute (<bang>0 ? "lua require('nuwiki.commands').export_all_force()" : "lua require('nuwiki.commands').export_all()")
|
||||
|
||||
" Phase 19 buffer attach: keymaps + text objects + folding.
|
||||
lua require('nuwiki.ftplugin').attach(0)
|
||||
|
||||
Reference in New Issue
Block a user