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

feat: apply line highlight only on focused buffer #6

Merged
merged 3 commits into from
Sep 13, 2021

Conversation

fitrh
Copy link
Collaborator

@fitrh fitrh commented Sep 13, 2021

This option enabled by passing focus_only = true to the options, the default is set to false, or do you think it is better to enabled by default ?

The default value set to false, if this key set to true, autocmds will
be added to the augroup to set cursorline state, which is will enable
line higlight only on focused buffer.
This autocmds is added when the `config.focus_only` set to true,
the default is false.
The use case:
    I opened 2 buffers, in the current focus buffer, I entered the
    `visual` mode, and then jump to the next buffer, the next buffer
    has `visual` mode line highlight even tough I am in `normal` mode

Adding `WinLeave` fixed that scenario.
@fitrh
Copy link
Collaborator Author

fitrh commented Sep 13, 2021

There is still an issue with telescope prompt (or maybe any other prompt that have input prompt), i think it will be better if we can disable insert mode line highlight for specific buffer.

20210913_101045_full

@mvllow
Copy link
Owner

mvllow commented Sep 13, 2021

I think less options is better. Ideally the coloured cursorline would only be on focused buffer

Edit: After seeing how this option changes the cursorline setting it may be best to have it opt-in. If you agree I'll merge how it is now

@fitrh
Copy link
Collaborator Author

fitrh commented Sep 13, 2021

I think so, you can merge it if you happy with the current implementation

@mvllow mvllow merged commit f18ca9b into mvllow:main Sep 13, 2021
@fitrh fitrh deleted the feat/hl-focus-buffer branch September 13, 2021 20:17
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.

2 participants