Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CursorLineNr highlight disappears when moving up through folds #22232

Closed
mcauley-penney opened this issue Feb 12, 2023 · 3 comments · Fixed by #22242
Closed

CursorLineNr highlight disappears when moving up through folds #22232

mcauley-penney opened this issue Feb 12, 2023 · 3 comments · Fixed by #22242
Assignees
Labels
bug issues reporting wrong behavior column sign/number column folds highlight

Comments

@mcauley-penney
Copy link

Describe the bug

When using a the statuscolumn option and moving up the buffer line by line over folded text, the CursorLineNr highlight disappears. See the GIF below for an example.

statuscol_fold

Steps to reproduce

I can reproduce this with o.statuscolumn = "%{v:relnum? v:relnum:v:lnum}".

Expected behavior

The expected behavior is that the CursorLineNr highlight would not disappear when moving across folded text.

Neovim version (nvim -v)

NVIM v0.9.0-dev-934+g9668c166e,

Vim (not Nvim) behaves the same?

No, statuscolumn is not a vim feature

Operating system/version

Linux 6.1.9-arch1-2

Terminal name/version

xterm 378

$TERM environment variable

xterm-256color

Installation

build from repo

@mcauley-penney mcauley-penney added the bug issues reporting wrong behavior label Feb 12, 2023
@zeertzjq zeertzjq added highlight column sign/number column folds labels Feb 12, 2023
@luukvbaal
Copy link
Contributor

Can't seem to reproduce for now, could you try to make a minimal reproducible example including nvim --clean?

@zeertzjq zeertzjq added the needs:repro We need minimal steps to reproduce the issue label Feb 12, 2023
@luukvbaal
Copy link
Contributor

I can reproduce a similar issue but it is present without 'statuscolumn' set as well:

nvim --clean +"set nu cul culopt=number fdc=1 | call setline(1, repeat(['aaaa'],10)) | 1,5fold | norm zojzc"

The cursor highlight is gone until the cursor is moved again(also when pressing the normal command keys instead). Can't reproduce a case where moving the cursor back and forth from the folded line keeps omitting the cursorline hightlight.

@mcauley-penney
Copy link
Author

mcauley-penney commented Feb 12, 2023

This is labeled wrong because I didn't thoroughly investigate. That's my fault, I apologize. I can reproduce it consistently on HEAD with the below settings using nvim --clean:

set nu
set cursorline
set foldmethod=indent
nnoremap n gj
nnoremap e gk 

The real culprit in my setup are those mappings. Without them, the issue disappears. I'd like to relabel this issue, it is NOT the statuscolumn.

luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 13, 2023
Problem:    The cursor line number was inaccurate when closing a fold
            and when moving to a closed fold with screenrow motions.
Solution:   Update cursor line number to the first line of the closed
            fold.

Fix neovim#22232
@luukvbaal luukvbaal removed the needs:repro We need minimal steps to reproduce the issue label Feb 13, 2023
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 13, 2023
Problem:    The cursor line number was inaccurate when closing a fold
            and when moving to a closed fold with screenrow motions.
Solution:   Update cursor line number to the first line of the closed
            fold.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 13, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 13, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
@zeertzjq zeertzjq changed the title Statuscolumn: CursorLineNr highlight disappears when moving up through folds CursorLineNr highlight disappears when moving up through folds Feb 14, 2023
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
luukvbaal added a commit to luukvbaal/neovim that referenced this issue Feb 14, 2023
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.

Fix neovim#22232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior column sign/number column folds highlight
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants