From 2a8b65e105ec1a1a9d4cecf947b7267f04453b7c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 23 Jan 2024 12:17:40 +0900 Subject: Fix highlighting of regions that are matched multiple times Fix #3596 --- src/result.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/result.go') diff --git a/src/result.go b/src/result.go index d72de420..b0428294 100644 --- a/src/result.go +++ b/src/result.go @@ -138,7 +138,9 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme, for i := off[0]; i < off[1]; i++ { // Negative of 1-based index of itemColors // - The extra -1 means highlighted - cols[i] = cols[i]*-1 - 1 + if cols[i] >= 0 { + cols[i] = cols[i]*-1 - 1 + } } } -- cgit v1.2.3