From d6741a2bd3c2a92eaa10d54878aad59fa51c8ae9 Mon Sep 17 00:00:00 2001 From: maxlandon Date: Tue, 11 Feb 2025 21:27:55 +0100 Subject: [PATCH] Fix a bug with selection highlight as reverse --- internal/display/highlight.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/display/highlight.go b/internal/display/highlight.go index 5da978c..5bf6cf2 100644 --- a/internal/display/highlight.go +++ b/internal/display/highlight.go @@ -191,7 +191,7 @@ func (e *Engine) hlReset(regions []core.Selection, line []rune, pos int) ([]core for i, reg := range regions { _, epos := reg.Pos() foreground, background := reg.Highlights() - matcher := reg.Type == "matcher" + // matcher := reg.Type == "matcher" if epos != pos { continue @@ -208,14 +208,18 @@ func (e *Engine) hlReset(regions []core.Selection, line []rune, pos int) ([]core } if background != "" { - background, _ := strconv.Unquote(e.opts.GetString("active-region-end-color")) - foreground := e.opts.GetString("active-region-start-color") - - if background == "" && foreground == "" && !matcher { - line = append(line, []rune(color.ReverseReset)...) - } else { - line = append(line, []rune(color.BgDefault)...) - } + // background, _ := strconv.Unquote(e.opts.GetString("active-region-end-color")) + // foreground := e.opts.GetString("active-region-start-color") + line = append(line, []rune(color.ReverseReset)...) + line = append(line, []rune(color.BgDefault)...) + // if background == "" && foreground == "" && !matcher { + // line = append(line, []rune(color.ReverseReset)...) + // } else { + // + // line = append(line, []rune(color.BgDefault)...) + // } + // + // line = append(line, []rune(color.ReverseReset)...) } }