From d6672fe218a4f888229bf30abc409c8052b6a68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Thu, 28 May 2026 20:03:32 -0300 Subject: [PATCH] fix(conceal): reveal cursor line in normal mode for natural navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ftplugin/vimwiki.vim | 7 ++++++- scripts/test-keymaps-vim.vim | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index e628756..cf1bf62 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -19,7 +19,12 @@ setlocal formatoptions+=ron setlocal suffixesadd=.wiki setlocal iskeyword+=- 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<' diff --git a/scripts/test-keymaps-vim.vim b/scripts/test-keymaps-vim.vim index 5b7c401..908bed4 100644 --- a/scripts/test-keymaps-vim.vim +++ b/scripts/test-keymaps-vim.vim @@ -307,6 +307,20 @@ call s:record( \ 'folding.starts_with_all_folds_open', \ '&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 ===== call add(s:results, '')