Don't wrap name highlights with colons

Name suggestions would wrap a name in colons instead of just emotes.  It
looks like this may have still worked fine, but it wasn't the correct
behavior.
This commit is contained in:
Zorchenhimer 2020-04-27 12:50:29 -04:00
parent 94a4f08467
commit 16c36ca9bc
1 changed files with 3 additions and 1 deletions

View File

@ -74,14 +74,16 @@ func processMessageKey(this js.Value, v []js.Value) interface{} {
msg := global.Get("msg")
val := msg.Get("value").String()
newval := val[:startIdx]
wrap := string(suggestionEmote)
if i := strings.LastIndex(newval, string(currentSugType)); i != -1 {
var offset int
if currentSugType == suggestionName {
offset = 1
wrap = ""
}
newval = newval[:i+offset] + ":" + currentSug + ":"
newval = newval[:i+offset] + wrap + currentSug + wrap
}
endVal := val[startIdx:]