Skip to content

Commit

Permalink
Use transparent background for gutter line number in GUI mode (nordth…
Browse files Browse the repository at this point in the history
…eme#204)

The `LineNr` and `CursorLineNr` highlight groups now have a transparent
background in GUI mode.

Before it was set to `nord0_gui` which worked fine in most cases.
However, some plugins use these highlight groups to render their content
in a popup window which can potentially have a different background
color. This caused some issues e.g. for the fuzzy search plugin
LeaderF [1].

The compatibility with the `g:nord_cursor_line_number_background`
theme configuration has been verified to work as expected in both modes
when it is set to `0` or `1`.

This change is not related to the terminal mode or when using
`set notermguicolors` since `ctermbg` for `LineNr` and `CursorLineNr`
is set to `NONE` by default.

[1]: https://github.com/Yggdroot/LeaderF
  • Loading branch information
xulongwu4 authored May 7, 2020
1 parent 974a919 commit 6323f66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colors/nord.vim
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ call s:hi("Cursor", s:nord0_gui, s:nord4_gui, "", "NONE", "", "")
call s:hi("CursorLine", "", s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
call s:hi("Error", s:nord4_gui, s:nord11_gui, "", s:nord11_term, "", "")
call s:hi("iCursor", s:nord0_gui, s:nord4_gui, "", "NONE", "", "")
call s:hi("LineNr", s:nord3_gui, s:nord0_gui, s:nord3_term, "NONE", "", "")
call s:hi("LineNr", s:nord3_gui, "NONE", s:nord3_term, "NONE", "", "")
call s:hi("MatchParen", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "", "")
call s:hi("NonText", s:nord2_gui, "", s:nord3_term, "", "", "")
call s:hi("Normal", s:nord4_gui, s:nord0_gui, "NONE", "NONE", "", "")
Expand Down Expand Up @@ -219,7 +219,7 @@ endif
"+--- Gutter ---+
call s:hi("CursorColumn", "", s:nord1_gui, "NONE", s:nord1_term, "", "")
if g:nord_cursor_line_number_background == 0
call s:hi("CursorLineNr", s:nord4_gui, s:nord0_gui, "NONE", "", "NONE", "")
call s:hi("CursorLineNr", s:nord4_gui, "", "NONE", "", "NONE", "")
else
call s:hi("CursorLineNr", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
endif
Expand Down

0 comments on commit 6323f66

Please sign in to comment.