From c298e7c841a9f47b8e4eaa52f965525a1f6b097d Mon Sep 17 00:00:00 2001 From: Noboru Saito Date: Tue, 10 Oct 2023 15:36:52 +0900 Subject: [PATCH] Fixed multicolor's candidates Fixed that multicolor candidates did not have the latest history. --- oviewer/document.go | 1 + oviewer/input_multicolor.go | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/oviewer/document.go b/oviewer/document.go index d00cd9aa..a61439fe 100644 --- a/oviewer/document.go +++ b/oviewer/document.go @@ -466,6 +466,7 @@ func (m *Document) setSectionDelimiter(delm string) { // setMultiColorWords set multiple strings to highlight with multiple colors. func (m *Document) setMultiColorWords(words []string) { + m.MultiColorWords = words m.multiColorRegexps = multiRegexpCompile(words) } diff --git a/oviewer/input_multicolor.go b/oviewer/input_multicolor.go index 437e494d..8530924a 100644 --- a/oviewer/input_multicolor.go +++ b/oviewer/input_multicolor.go @@ -15,12 +15,10 @@ func (root *Root) setMultiColorMode() { input.value = "" input.cursorX = 0 + searches := root.searchCandidates(searchCandidateListLen) + input.MultiColorCandidate.toLast(strings.Join(searches, " ")) old := root.Doc.MultiColorWords input.MultiColorCandidate.toLast(strings.Join(old, " ")) - list := root.searchCandidates(searchCandidateListLen) - str := strings.Join(list, " ") - input.MultiColorCandidate.toLast(str) - input.Event = newMultiColorEvent(input.MultiColorCandidate) }