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

Proposal: Add 'cursorlineopt' option #4693

Closed
wants to merge 2 commits into from

Conversation

@ichizok
Copy link

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

This comment has been minimized.

Copy link
Member

commented Jul 18, 2019

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Contributor

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 ichizok:feature/cursorlineopt branch Sep 9, 2019

@chrisbra

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

@chrisbra chrisbra referenced this pull request Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.