Browse Source

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.
pull/1/head
Zorchenhimer 1 year ago
parent
commit
16c36ca9bc
  1. 4
      wasm/suggestions.go

4
wasm/suggestions.go

@ -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:]

Loading…
Cancel
Save