Improve highlighting of Kakrc string regions

Unfortunately Strings that start with a quoted quote (like '''str')
are still incorrectly highlighted, a deeper refactoring of the regions
highlighter will be necessary.
This commit is contained in:
Maxime Coste 2018-06-17 11:06:20 +10:00
parent 759a253923
commit 7abf04babd
2 changed files with 3 additions and 3 deletions

View File

@ -13,8 +13,8 @@ hook global BufCreate (.*/)?(kakrc|.*.kak) %{
add-highlighter shared/ regions -default code kakrc \
comment (^|\h)\K# $ '' \
double_string %{(^|\h)\K"} %{(?<!")("")*"(?!")} '' \
single_string %{(^|\h)\K'} %{(?<!')('')*'(?!")} '' \
double_string %{(^|\h)\K"} %{"(?!")} %{(?<!")("")+(?!")} \
single_string %{(^|\h)\K'} %{'(?!')} %{(?<!')('')+(?!')} \
shell '(^|\h)\K%?%sh\{' '\}' '\{' \
shell '(^|\h)\K%?%sh\(' '\)' '\(' \
shell '(^|\h)\K%?%sh\[' '\]' '\[' \

View File

@ -1709,7 +1709,7 @@ struct RegionMatches
return end_it;
while (rec_it != recurse_matches.end() and
rec_it->end_coord() <= end_it->begin_coord())
rec_it->end_coord() <= end_it->end_coord())
{
if (not capture or rec_it->capture == *capture)
++recurse_level;