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

[Feature request] Support special highlight groups. #40

Open
kevinhwang91 opened this issue Feb 4, 2020 · 4 comments
Open

[Feature request] Support special highlight groups. #40

kevinhwang91 opened this issue Feb 4, 2020 · 4 comments

Comments

@kevinhwang91
Copy link

kevinhwang91 commented Feb 4, 2020

Some SynID can't get by function synID({lnum}, {col}, {trans}), such as Search and other Plugins like semshi add highlight by nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, {col_start}, {col_end}). I think this feature can't cause any performance issue, please correct me if I was wrong.

Here is the issue recording by asciinema.
https://asciinema.org/a/297762

If you want to support this feature, please enable special highlight groups by filetype because not only python but others plugins can invoke nvim_buf_add_highlight

@TaDaa
Copy link
Owner

TaDaa commented Feb 4, 2020

I will say for search vimade.fadepriority can be used to show Search highlights (the default setting hides them), but Search will not fade. Search should be supported w/ fading for Neovim when I get to #26 as set winhl should work (I should get to this soon).

I'll look into supporting other special highlight groups like the nvim_buf_add_highlight that you mentioned, but I'm not sure they can currently be introspected (same thing with virtual text).

@kevinhwang91
Copy link
Author

I don't think any neovim'api can solve the issue at present. Maybe give power to the user to write down the highlight group into vimade configuration.

@TaDaa
Copy link
Owner

TaDaa commented Feb 5, 2020

Looks like virtualtext is now inspectable by nvim_get_virtual_text() -- I'll try to add support for this one at some point.

For winhl there will be vimade.basegroups property exposed for neovim to override highlights. However the caveat is that Neovim only allows certain built-in highlights to be overridden. So this may (not 100% sure) work for nvim_buf_add_highlight only if the highlight groups are linked to built-in ones. It would be awesome if Neovim opened up winhl to other highlights -- I may open an issue for this, but they may also have reasons for limiting it.

Still thinking about how to fully support nvim_buf_highlight, but here are a several possibilities:

  • Tie into the Neovim api events .
  • open Neovim issue for nvim_buf_add_highlight inspection
  • nvim__inspect_cell() -- documentation = TODO -- seems like it may return the relevant information, however need the grid number
  • extmarks? - have to look into this one, but might be relevant

There might be another issue as I don't see documentation for priority for nvim_buf_add_highlight. I'm not quite sure how well multiple plugins play together using that function (which plugin wins the UI display -- I'm guessing its the last caller), however this might lead to situations where fades are inconsistently displaying.

---edit---
Actually I think matchaddpos() wins over nvim_buf_add_highlight, so priority might be solved already -- will double check though

TaDaa added a commit that referenced this issue Feb 6, 2020
…specify built-in highlights that will be faded. Basegroup fading is enabled by default. Signs are now enabled by default with performance improvements and follow the same text fading pattern (only visible/scrollable areas are faded). Related to #41 - Fix Folded and other issues in python2.  Added additional fix to account for tabstop
@TaDaa
Copy link
Owner

TaDaa commented Feb 6, 2020

Commit above addresses Search

vimade.basegroups can now be used to customize built-in highlighting; its pre-initialized with ['Folded', 'Search', 'SignColumn', 'LineNr', 'CursorLine', 'CursorLineNr', 'DiffAdd', 'DiffChange', 'DiffDelete', 'DiffText', 'FoldColumn', 'Whitespace'].

For fading Search, just set vimade.fadepriority=0 and it should now be good to go.

TaDaa added a commit that referenced this issue Aug 27, 2024
…g features and extends functionality for full customization. Docs will be updated soon. Related to #79, #60, #55, #53, #51, #50, #44, #43, #40, #17.  Adds new fademode option that can be configured with either 'windows' or 'buffers' (works in Neovim+Vim).  Neovim users will default to new renderer if pythong is not installed, otherwise use `let g:vimade.renderer='lua'`.  The existing (vim/legacy) renderer will be updated to support most of the same functionality as the lua version (custom tint and/or fade per windows and completely flexible config options)
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

No branches or pull requests

2 participants