Skip to content

Commit 1910eb9

Browse files
committedMay 10, 2020
hotfix highlighting issues
when you highlight incrementally you keep adding escape codes to the string these escape codes contain chracters that next round of highlighting can wrap in a new set of escape codes this breaks the escape codes and produces mess on the view hotfix: sort the terms so that the short ones are highlighted first
1 parent 92c15c6 commit 1910eb9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎cmd/cli/query.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"log"
5+
"sort"
56
"strings"
67
)
78

@@ -54,6 +55,7 @@ func newQueryFromString(queryInput string, host string, pwd string, gitOriginRem
5455
log.Println("QUERY filtered terms =" + logStr)
5556
log.Println("QUERY pwd =" + pwd)
5657
}
58+
sort.SliceStable(terms, func(i, j int) bool { return len(terms[i]) < len(terms[j]) })
5759
return query{
5860
terms: terms,
5961
host: host,

0 commit comments

Comments
 (0)
Please sign in to comment.