Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion internal/display/bufwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ func (w *BufWindow) displayBuffer() {
}

if highlight {
if w.Buf.HighlightSearch && w.Buf.SearchMatch(bloc) {
isHighlightSearchMatch := w.Buf.HighlightSearch && w.Buf.SearchMatch(bloc)
if isHighlightSearchMatch {
style = config.DefStyle.Reverse(true)
if s, ok := config.Colorscheme["hlsearch"]; ok {
style = s
Expand All @@ -648,6 +649,12 @@ func (w *BufWindow) displayBuffer() {
if s, ok := config.Colorscheme["selection"]; ok {
style = s
}

if isHighlightSearchMatch {
if s, ok := config.Colorscheme["hlsearch.selection"]; ok {
style = s
}
}
}

if b.Settings["cursorline"].(bool) && w.active && !preservebg &&
Expand Down
1 change: 1 addition & 0 deletions runtime/help/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Here is a list of the colorscheme groups that you can use:
* error-message (Color of error messages in the bottom line of the screen)
* match-brace (Color of matching brackets when `matchbracestyle` is set to `highlight`)
* hlsearch (Color of highlighted search results when `hlsearch` is enabled)
* hlsearch.selection (Color of the selection within the highlighted search results)
* tab-error (Color of tab vs space errors when `hltaberrors` is enabled)
* trailingws (Color of trailing whitespaces when `hltrailingws` is enabled)

Expand Down
Loading