tree-sitter-bash icon indicating copy to clipboard operation
tree-sitter-bash copied to clipboard

Bash regex containing single-quote space next to string literal breaks highlighting beyond its point

Open mooreye opened this issue 1 year ago • 0 comments

Consider the attached snippet. It contains a Bash regex that checks if a variable contains a (note the space). However when using Treesitter, everything beyond the first ' character in the regex is unhighlighted, until the end of the document.

Issue first detected in Neovim. With treesitter plugin disabled, it works fine.

Example snippet that causes the problem

#!/usr/bin/bash

v='a b'
if [[ $v =~ a' ' ]]; then
    echo ok
fi

Example screenshot

image

mooreye avatar Sep 27 '24 17:09 mooreye