From b6952c89dde3687202cd397db37dc96344a444e0 Mon Sep 17 00:00:00 2001 From: laniakea64 Date: Sun, 4 Aug 2024 10:22:01 -0400 Subject: [PATCH] Fix highlighting of boolean `set` followed by inline comment --- syntax/just.vim | 2 +- tests/cases/set.html | 15 +++++++++++++++ tests/cases/set.just | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/syntax/just.vim b/syntax/just.vim index 415ac53..e9c0577 100644 --- a/syntax/just.vim +++ b/syntax/just.vim @@ -163,7 +163,7 @@ syn keyword justSetKeywords \ allow-duplicate-recipes allow-duplicate-variables dotenv-load dotenv-filename dotenv-path dotenv-required export fallback ignore-comments positional-arguments quiet script-interpreter shell tempdir unstable windows-shell working-directory \ contained syn keyword justSetDeprecatedKeywords windows-powershell contained -syn match justBooleanSet "\v^set%(\s|\\\n)+%(allow-duplicate-%(recip|variabl)es|dotenv-%(loa|require)d|export|fallback|ignore-comments|positional-arguments|quiet|unstable|windows-powershell)%(%(\s|\\\n)*:\=%(\s|\\\n)*%(true|false))?$" +syn match justBooleanSet "\v^set%(\s|\\\n)+%(allow-duplicate-%(recip|variabl)es|dotenv-%(loa|require)d|export|fallback|ignore-comments|positional-arguments|quiet|unstable|windows-powershell)%(%(\s|\\\n)*:\=%(\s|\\\n)*%(true|false))?%(\s|\\\n)*%($|#@=)" \ contains=justSet,justSetKeywords,justSetDeprecatedKeywords,justAssignmentOperator,justBoolean \ transparent diff --git a/tests/cases/set.html b/tests/cases/set.html index ce5f3a1..de8b1f0 100644 --- a/tests/cases/set.html +++ b/tests/cases/set.html @@ -43,6 +43,21 @@ set fallback:= true set fallback :=false +# the trailing whitespace at the end of the following lines is intentional +set fallback +set fallback := true +set fallback := false + +set fallback # comment +set fallback := true # comment +set fallback := true# comment + +set fallback := true \ + # comment + +set fallback := false\ +#comment + set tempdir := '/tmp' set tempdir := """ /tmp""" diff --git a/tests/cases/set.just b/tests/cases/set.just index a81aa5d..35688e2 100644 --- a/tests/cases/set.just +++ b/tests/cases/set.just @@ -43,6 +43,21 @@ set fallback:=false set fallback:= true set fallback :=false +# the trailing whitespace at the end of the following lines is intentional +set fallback +set fallback := true +set fallback := false + +set fallback # comment +set fallback := true # comment +set fallback := true# comment + +set fallback := true \ + # comment + +set fallback := false\ +#comment + set tempdir := '/tmp' set tempdir := """ /tmp"""