fix(conceal): reveal cursor line in normal mode for natural navigation
concealcursor=nc kept the cursor's own line concealed in normal mode, so the hidden characters of a wikilink ([[, target, ]]) still occupied buffer columns — each l/h moved one hidden position with no visible movement, making the cursor feel stuck. Drop the `n` flag (keep `c` for incsearch) so the cursor line shows raw markup in normal mode while other lines stay concealed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,12 @@ setlocal formatoptions+=ron
|
|||||||
setlocal suffixesadd=.wiki
|
setlocal suffixesadd=.wiki
|
||||||
setlocal iskeyword+=-
|
setlocal iskeyword+=-
|
||||||
setlocal conceallevel=2
|
setlocal conceallevel=2
|
||||||
setlocal concealcursor=nc
|
" Reveal the cursor line's raw markup in normal mode so left/right motions
|
||||||
|
" move over visible characters instead of stalling on hidden conceal regions
|
||||||
|
" (e.g. the `[[`, target, and `]]` of a wikilink). Other lines stay concealed.
|
||||||
|
" Insert/visual already reveal the cursor line; only incsearch (`c`) keeps it
|
||||||
|
" concealed so `/` highlighting isn't disrupted.
|
||||||
|
setlocal concealcursor=c
|
||||||
|
|
||||||
let b:undo_ftplugin = 'setlocal commentstring< comments< formatoptions< suffixesadd< iskeyword< conceallevel< concealcursor<'
|
let b:undo_ftplugin = 'setlocal commentstring< comments< formatoptions< suffixesadd< iskeyword< conceallevel< concealcursor<'
|
||||||
|
|
||||||
|
|||||||
@@ -307,6 +307,20 @@ call s:record(
|
|||||||
\ 'folding.starts_with_all_folds_open',
|
\ 'folding.starts_with_all_folds_open',
|
||||||
\ '&l:foldlevel=' . &l:foldlevel)
|
\ '&l:foldlevel=' . &l:foldlevel)
|
||||||
|
|
||||||
|
" ===== Conceal =====
|
||||||
|
|
||||||
|
" The ftplugin reveals the cursor line in normal mode (concealcursor has no
|
||||||
|
" `n`) so left/right motions move over visible characters instead of stalling
|
||||||
|
" on hidden conceal regions like a wikilink's `[[`/`]]`.
|
||||||
|
call s:record(
|
||||||
|
\ &l:conceallevel == 2 ? 1 : 0,
|
||||||
|
\ 'conceal.level_is_two',
|
||||||
|
\ '&l:conceallevel=' . &l:conceallevel)
|
||||||
|
call s:record(
|
||||||
|
\ &l:concealcursor !~# 'n' ? 1 : 0,
|
||||||
|
\ 'conceal.cursor_line_revealed_in_normal_mode',
|
||||||
|
\ '&l:concealcursor=' . &l:concealcursor)
|
||||||
|
|
||||||
" ===== Wrap up =====
|
" ===== Wrap up =====
|
||||||
|
|
||||||
call add(s:results, '')
|
call add(s:results, '')
|
||||||
|
|||||||
Reference in New Issue
Block a user