Skip to content

Proposal: Add 'cursorlineopt' option#4693

Closed
ichizok wants to merge 2 commits intovim:masterfrom
ichizok:feature/cursorlineopt
Closed

Proposal: Add 'cursorlineopt' option#4693
ichizok wants to merge 2 commits intovim:masterfrom
ichizok:feature/cursorlineopt

Conversation

@ichizok
Copy link
Contributor

@ichizok ichizok commented Jul 17, 2019

The continuation of https://groups.google.com/forum/#!topic/vim_dev/dQ-5znirV4Y

I created this pull-req in order to update the patch and test on CI.

Summary:

'cursorlineopt' changes the behavior of 'cursorline'.
'cursorlineopt' accepts one of the following string values:

  • line: Highlight the screen line of the cursor with CursorLine.
  • number: Highlight only the line number of the cursor with CursorLineNr.
  • both (default): line and number. This is the current behavior.

@chrisbra
Copy link
Member

can we add an option, that makes CursorLine highlight only the current screen line (in contrast to the complete physical line that might span several screen lines). This can be annoying. I have an old patch for that behaviour (that introduces the cursorscreenline option).

https://groups.google.com/d/msg/vim_dev/1Yc9Z-82Z80/GXrCoPSdi3IJ
https://github.com/chrisbra/vim-mq-patches/blob/master/cursorscreenline

@ichizok
Copy link
Contributor Author

ichizok commented Jul 18, 2019

There is the user request that want to highlight only the current line number but not line.
It can do by hi CursorLine clear but setting a highlight is somewhat complicated (e.g. when revert previous highlighting).

@brammool
Copy link
Contributor

brammool commented Sep 9, 2019

Looks ready to include. Christian: You could add the "screenline" option to 'cursorlineopt' and merge in your old patch. Hmm, only question is what to use for "both" then, for highlighting the line number and the screen line? Or would you never highlight the line number and one screen line?

@brammool brammool closed this in 410e98a Sep 9, 2019
@ichizok ichizok deleted the feature/cursorlineopt branch September 9, 2019 20:44
@chrisbra
Copy link
Member

Christian: You could add the "screenline" option to 'cursorlineopt' and merge in your old patch. Hmm, only question is what to use for "both" then, for highlighting the line number and the screen line? Or would you never highlight the line number and one screen line?

Looking at this currently. It is a bit more effort than initially thought, because the win_line has changed quite a bit in the last couple of years. Currently I am implementing the screenline option for the 'cursorlineopt'. Is there any reason besides backwards-compatibility to not have the cursorline always work on screen lines?

@brammool
Copy link
Contributor

brammool commented Sep 12, 2019 via email

manuelschiller pushed a commit to manuelschiller/vim that referenced this pull request Nov 10, 2019
Problem:    'cursorline' always highlights the whole line.
Solution:   Add 'cursorlineopt' to specify what is highlighted.
            (closes vim#4693)
janlazo pushed a commit to neovim/neovim that referenced this pull request Jul 31, 2021
…5161)

Problem:    'cursorline' always highlights the whole line.
Solution:   Add 'cursorlineopt' to specify what is highlighted.
            (closes vim/vim#4693)
vim/vim@410e98a
lewis6991 pushed a commit to lewis6991/neovim that referenced this pull request Dec 12, 2021
…ovim#15161)

Problem:    'cursorline' always highlights the whole line.
Solution:   Add 'cursorlineopt' to specify what is highlighted.
            (closes vim/vim#4693)
vim/vim@410e98a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants