highlight icon indicating copy to clipboard operation
highlight copied to clipboard

Escaped ^ and $ don't get handled correctly in findIndex and findAllIndex

Open Andriamanitra opened this issue 2 years ago • 0 comments

https://github.com/zyedidia/highlight/blob/291680feaca1bae8a5da754ac5626963657f2948/highlighter.go#L96 does not check if there is a backslash before the character. This causes various issues in micro-editor's syntax highlighting (for example https://github.com/zyedidia/micro/issues/2397, I have noticed similar problems in other languages too).

I thought about fixing it by simply checking if the previous character is a backslash, and although that would be an improvement it would still not be exactly correct because that backslash itself could be escaped by another backslash and so on. I'm not comfortable enough with Go-lang to go for a more proper fix myself.

Andriamanitra avatar Apr 27 '22 16:04 Andriamanitra