[vim/vim] `CursorLineFold` and `CursorLineSign` usage depends on 'cursorlineopt' (Issue #20480)

0 views
Skip to first unread message

Evgeni Chasnovski

unread,
4:44 AM (3 hours ago) 4:44 AM
to vim/vim, Subscribed
echasnovski created an issue (vim/vim#20480)

Steps to reproduce

  1. Create the following 'init.vim':

     set number signcolumn=yes foldcolumn=1
     set cursorline cursorlineopt=line
    
     hi CursorLineNr ctermbg=Red guibg=Red
     hi CursorLineSign ctermbg=Yellow guibg=Yellow
     hi CursorLineFold ctermbg=Green guibg=Green
  2. vim --clean -u init.vim

  3. Observe that sign and fold columns at cursor line are not highlighted as Yellow and Green. Even though 'cursorline' is set and the help describes the behavior as "Like {Fold,Sign}Column when 'cursorline' is set for the cursor line.".

  4. :set cursorlineopt=both. Now all CursorLine{Nr,Sign,Fold} are highlighted as red-yellow-green. So all of their behavior matches what is described in CursorLineNr: "Like LineNr when 'cursorline' is set and 'cursorlineopt' contains "number" or is "both", for the cursor line."

Expected behaviour

One of:

  1. Behavior matches the documentation: CursorLineFold and CursorLineSign do not depend on the 'cursorlineopt' value.
  2. Documentation matches the behavior: "Like {Fold,Sign}Column when 'cursorline' is set and 'cursorlineopt' contains "number" or is "both", for the cursor line.".
  3. Add sign and fold possible flags to 'completeopt'. With or without adding them to default value. Maybe rename both to all or only add all possible flag.

The 1 is somewhat of a breaking change. The 2 is somewhat confusing in its current form. The 3 is more "correct" but is also somewhat breaking while requiring more work.

Version of Vim

9.2.600

Environment

OS: EndeavourOS Linux x86_64, 7.0.11-arch1-1
Terminal: Ghostty 1.3.1-arch2
$TERM: xterm-ghostty
Shell: 0.113.1

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20480@github.com>

Reply all
Reply to author
Forward
0 new messages