feat(client): wire full Vimwiki command-parity surface
Register the named :Vimwiki*/:Nuwiki* entry points that previously
existed only as mappings or were missing entirely — including
RemoveSingleCB/RemoveCBInList, CatUrl, TabMakeDiaryNote,
NormalizeLink, Renumber{List,AllLists}, TableAlign, ChangeSymbol(InList),
ListToggle, Increment/DecrementListItem, and the DeleteLink/RenameLink/
GenerateTags compat aliases. Both the Vim (vim-lsp/coc) and Neovim
client functions are added to back them.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -363,14 +363,18 @@ endfunction
|
||||
|
||||
" ===== Diary =====
|
||||
|
||||
function! s:diary_open(cmd_name) abort
|
||||
function! s:diary_open(cmd_name, ...) abort
|
||||
let l:open = a:0 >= 1 ? a:1 : 'edit'
|
||||
call s:exec(a:cmd_name, [{ 'uri': s:buf_uri() }],
|
||||
\ function('s:open_uri_from'))
|
||||
\ {n -> s:open_uri_from(n, l:open)})
|
||||
endfunction
|
||||
|
||||
function! nuwiki#commands#diary_today() abort
|
||||
call s:diary_open('nuwiki.diary.openToday')
|
||||
endfunction
|
||||
function! nuwiki#commands#diary_today_tab() abort
|
||||
call s:diary_open('nuwiki.diary.openToday', 'tabedit')
|
||||
endfunction
|
||||
function! nuwiki#commands#diary_yesterday() abort
|
||||
call s:diary_open('nuwiki.diary.openYesterday')
|
||||
endfunction
|
||||
@@ -646,6 +650,24 @@ function! nuwiki#commands#list_remove_done_all() abort
|
||||
call s:exec('nuwiki.list.removeDone', l:args)
|
||||
endfunction
|
||||
|
||||
" `:VimwikiRemoveSingleCB` — strip the checkbox from the current item only.
|
||||
function! nuwiki#commands#list_remove_checkbox() abort
|
||||
let l:p = s:cursor_position()
|
||||
let l:args = [{ 'uri': l:p['textDocument']['uri'], 'position': l:p['position'] }]
|
||||
call s:exec('nuwiki.list.removeCheckbox', l:args)
|
||||
endfunction
|
||||
|
||||
" `:VimwikiRemoveCBInList` — strip checkboxes from every item in the list.
|
||||
function! nuwiki#commands#list_remove_checkbox_in_list() abort
|
||||
let l:p = s:cursor_position()
|
||||
let l:args = [{
|
||||
\ 'uri': l:p['textDocument']['uri'],
|
||||
\ 'position': l:p['position'],
|
||||
\ 'whole_list': v:true,
|
||||
\ }]
|
||||
call s:exec('nuwiki.list.removeCheckbox', l:args)
|
||||
endfunction
|
||||
|
||||
function! nuwiki#commands#list_renumber() abort
|
||||
let l:p = s:cursor_position()
|
||||
let l:args = [{ 'uri': l:p['textDocument']['uri'], 'position': l:p['position'] }]
|
||||
@@ -1108,6 +1130,20 @@ function! nuwiki#commands#normalize_link() abort
|
||||
call s:wrap_cword_as_wikilink()
|
||||
endfunction
|
||||
|
||||
function! s:echo_url_from(response, ...) abort
|
||||
let l:result = get(get(a:response, 'response', {}), 'result', '')
|
||||
if type(l:result) == type('') && l:result !=# ''
|
||||
echom l:result
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" `:VimwikiCatUrl` — echo the `file://` URL of the current page's HTML
|
||||
" export (the server computes the path from the wiki's html config).
|
||||
function! nuwiki#commands#cat_url() abort
|
||||
let l:args = [{ 'uri': s:buf_uri() }]
|
||||
call s:exec('nuwiki.link.catUrl', l:args, function('s:echo_url_from'))
|
||||
endfunction
|
||||
|
||||
" ===== Name-parity aliases =====
|
||||
"
|
||||
" The Lua surface and the VimL surface diverged on a handful of names:
|
||||
|
||||
Reference in New Issue
Block a user