Major clean up and improvements to vimwiki compatibility and documentation.
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
" autoload/nuwiki/commands.vim — Vim-side wrappers around the LSP
|
||||
" commands the server advertises (Phase 19).
|
||||
" commands the server advertises.
|
||||
"
|
||||
" Lives in autoload/ so the cost is paid only when a `:Vimwiki*` /
|
||||
" `:Nuwiki*` command is actually invoked. Dispatches via vim-lsp's
|
||||
@@ -107,7 +107,7 @@ endfunction
|
||||
|
||||
function! s:notify_deferred(name) abort
|
||||
echohl WarningMsg
|
||||
echom 'nuwiki: ' . a:name . ' is not yet implemented — see SPEC §13.1'
|
||||
echom 'nuwiki: ' . a:name . ' is not yet implemented'
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
@@ -478,6 +478,13 @@ endfunction
|
||||
function! nuwiki#commands#cycle_list_item() abort
|
||||
call s:exec_pos('nuwiki.list.cycleCheckbox')
|
||||
endfunction
|
||||
" `glp` cycles backward — same command, `reverse` flag in the payload.
|
||||
function! nuwiki#commands#cycle_list_item_back() abort
|
||||
let l:p = s:cursor_position()
|
||||
let l:args = [{ 'uri': l:p['textDocument']['uri'],
|
||||
\ 'position': l:p['position'], 'reverse': v:true }]
|
||||
call s:exec('nuwiki.list.cycleCheckbox', l:args)
|
||||
endfunction
|
||||
function! nuwiki#commands#reject_list_item() abort
|
||||
call s:exec_pos('nuwiki.list.rejectCheckbox')
|
||||
endfunction
|
||||
@@ -627,11 +634,20 @@ function! nuwiki#commands#rename_file() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" ===== §13.1 deferred =====
|
||||
" ===== Deferred =====
|
||||
|
||||
" §13.1 Cluster A — list rewriters.
|
||||
" Cluster A — list rewriters.
|
||||
|
||||
" `gl<Space>` — remove done items from the current list only. Passing the
|
||||
" cursor position scopes the server to the contiguous list block under it.
|
||||
function! nuwiki#commands#list_remove_done() abort
|
||||
let l:p = s:cursor_position()
|
||||
let l:args = [{ 'uri': l:p['textDocument']['uri'], 'position': l:p['position'] }]
|
||||
call s:exec('nuwiki.list.removeDone', l:args)
|
||||
endfunction
|
||||
|
||||
" `gL<Space>` — remove done items across the whole buffer (no position).
|
||||
function! nuwiki#commands#list_remove_done_all() abort
|
||||
let l:args = [{ 'uri': s:buf_uri() }]
|
||||
call s:exec('nuwiki.list.removeDone', l:args)
|
||||
endfunction
|
||||
@@ -721,7 +737,7 @@ function! nuwiki#commands#list_toggle_or_add_checkbox() abort
|
||||
let l:new = strpart(l:line, 0, l:end) . '[ ] ' . strpart(l:line, l:end)
|
||||
call setline('.', l:new)
|
||||
endfunction
|
||||
" §13.1 Cluster B — table rewriters.
|
||||
" Cluster B — table rewriters.
|
||||
|
||||
function! nuwiki#commands#table_insert(...) abort
|
||||
let l:cols = a:0 >= 1 ? str2nr(a:1) : 3
|
||||
@@ -799,7 +815,7 @@ function! nuwiki#commands#colorize(...) abort
|
||||
\ . strpart(l:line, l:right - 1)
|
||||
call setline('.', l:new)
|
||||
endfunction
|
||||
" §13.1 Cluster C — link helpers.
|
||||
" Cluster C — link helpers.
|
||||
|
||||
function! nuwiki#commands#paste_link() abort
|
||||
let l:p = s:cursor_position()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" autoload/nuwiki/lsp.vim — Vim (non-Neovim) LSP client wiring.
|
||||
"
|
||||
" Spec §7.4 preference order:
|
||||
" Preference order:
|
||||
" 1. vim-lsp (matoto/vim-lsp)
|
||||
" 2. coc.nvim
|
||||
" 3. Print an error if neither is available.
|
||||
|
||||
Reference in New Issue
Block a user