From afd1fa22171b9848a045a80845b76de62b93c76f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 15 Sep 2021 17:00:02 +0200 Subject: [PATCH] rc toml: fix wrong highlighting of triple quoted strings that have quotes at the end In TOML's triple-quoted strings, it's allowed to place quotes just next to the triple quotes. foo = '''bar'''' ^ part of the string contents ^^^ closing sequence We greedily interpret the first three single quotes as closing sequence. As a result the remaining single quote wrongly opens a new string. Fix this by only treating triple quotes as closing if they are not followed by another quote. I don't think there is another possible interpretation of quadruple quotes in TOML, so this should not affect other valid inputs. Fixes #4143 --- rc/filetype/toml.kak | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rc/filetype/toml.kak b/rc/filetype/toml.kak index d4adf3aa..bc78b0dd 100644 --- a/rc/filetype/toml.kak +++ b/rc/filetype/toml.kak @@ -35,10 +35,10 @@ provide-module toml %{ add-highlighter shared/toml regions add-highlighter shared/toml/code default-region group add-highlighter shared/toml/comment region '#' $ fill comment -add-highlighter shared/toml/string1 region '"""' (?