Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[RDY] Adds nvim_get_hl_by_name/by_id #7082
...in order to retrieve highlights.
I renamed EMPTY_ATTR to HLATTRS_INIT because it's more consistent with the rest of the code and it helps disambiguate the highlight vs attribute vs hlattr confusion. I can revert it though.
changed the title from
[RFC] Adds nvim_get_hl_by_name/by_id
Jul 27, 2017
Travis fails because of:
I removed the highlight change notification code to trim down the PR and the most controversial part.
(n)vim used to conflate the 'Normal' hl with the uninitialized attribute (attribute 0).
changed the title from
[rdy] Adds nvim_get_hl_by_name/by_id
[RDY] Adds nvim_get_hl_by_name/by_id
Sep 7, 2017
I understand not to merge code before a release but if #6428 targeted is still 0.2.1 I can provide subsequent patches once this is merged, 1 of ~ 6 lines to distinguish between NONE and other colors, the other is also ~10 lines but need some input on how to properly convey hl updates.
added a commit
this pull request
Oct 7, 2017
Oct 8, 2017
ba7277c seems to break the "new diminactive" I am using:
if exists('+winhighlight') function! s:configure_winhighlight() let ft = &filetype let bt = &buftype " Check white/blacklist. if &diff || (index(['dirvish'], ft) == -1 \ && (index(['nofile', 'nowrite', 'acwrite', 'quickfix', 'help'], bt) != -1 \ || index(['startify'], ft) != -1)) set winhighlight=Normal:MyNormalWin,NormalNC:MyNormalWin " echom "normal" winnr() &winhighlight 'ft:'.&ft 'bt:'.&bt else set winhighlight=Normal:MyNormalWin,NormalNC:MyInactiveWin " echom "inactive" winnr() &winhighlight 'ft:'.&ft 'bt:'.&bt endif endfunction augroup inactive_win au! au ColorScheme * hi link MyInactiveWin ColorColumn | hi link MyNormalWin Normal au FileType,BufWinEnter * call s:configure_winhighlight() if exists('##OptionSet') " TODO: does not work with :Gdiff - diffsplit does not trigger it, too! au OptionSet diff call s:configure_winhighlight() endif " XXX: redraw! should not be necessary, but is?! " NOTE: setting cursorline fixes it?! " au FocusGained * hi link MyNormalWin Normal | redraw! " au FocusLost * hi link MyNormalWin MyInactiveWin | redraw! " au FocusGained * hi link MyNormalWin Normal " au FocusLost * hi link MyNormalWin MyInactiveWin " au FocusGained * echom 'FG: '.&winhighlight " au FocusLost * echom 'FL: '.&winhighlight | verb hi MyNormalWin augroup END endif
It now dims the active window, but not the inactive ones after that commit.
in my code, I've tried to make the "Normal" group behave like any other group. I have splitted my PR so that it gets easier to review so I wonder if the problem might be due to this hunk (that should possibly belong to one of my other PR):
that might badly interact with winhighlight code
Maybe if you don't special case "Normal" highlight it works
I've got some trouble on my setup so I can't test this. I hope to be able to this weekend (unrelated but my brand new laptop screen refuses to turn on after 2 days of utilization :'( )