refactor(viml): extract shared heading_level/is_table_row/wiki_cfg; fix cap + spaceless
CI / editor tests (push) Successful in 44s
CI / editor tests (push) Successful in 44s
Mirrors the Lua util refactor. Pulls the copy-pasted VimL helpers into
autoload/nuwiki/util.vim and points the per-file s: stubs at it:
- heading_level (commands/folding/textobjects) — commands.vim's copy was
missing the >6 level cap the others had (a 7+ `=` line returned 7). The
unified version caps at 6 AND accepts spaceless headings (==Heading==),
matching the server lexer + the Lua client (so fold fallback, text
objects, and ]] navigation recognize spaceless headings too).
- is_table_row (commands/textobjects) — identical copies.
- wiki_cfg (commands/diary) — these had DRIFTED: commands.vim's included a
`space` (links_space_char) key diary.vim's lacked. Unified to the superset
so callers reading `.space` keep working; diary callers ignore the extra key.
Also refreshes the stale plugin/nuwiki.vim header ("all logic lives in the
Rust language server" → thin client; server is nuwiki-rs, downloaded).
Verified: 18-case heading battery in headless vim + full editor harness 10/10.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -4,8 +4,9 @@
|
||||
" their config (lazy.nvim does this automatically through `opts`). On Vim
|
||||
" we start the LSP client when a vimwiki buffer is loaded.
|
||||
"
|
||||
" This file contains wiring only — all logic lives in
|
||||
" the Rust language server.
|
||||
" This file contains wiring only. The editor layers (VimL + Lua) are thin
|
||||
" clients; the heavy lifting is done by the nuwiki-ls language server, which
|
||||
" is built from the separate nuwiki-rs repo and downloaded at install time.
|
||||
|
||||
if exists('g:loaded_nuwiki')
|
||||
finish
|
||||
|
||||
Reference in New Issue
Block a user