summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-03-26 13:04:31 +1100
committerMaxime Coste <mawww@kakoune.org>2019-03-26 13:04:31 +1100
commit4b98b894375226ddb62bb970312957f9bc5cb5f8 (patch)
tree3e734ee03f3d99b98d78d2a5483e4c905816c659
parent688afee41bd3439b06aeb0e59e0fc90dd8c63bab (diff)
sh.kak: Use a region for shell expansions
Fixes #2763
-rw-r--r--rc/filetype/sh.kak3
1 files changed, 2 insertions, 1 deletions
diff --git a/rc/filetype/sh.kak b/rc/filetype/sh.kak
index 517f6a18..acd62993 100644
--- a/rc/filetype/sh.kak
+++ b/rc/filetype/sh.kak
@@ -6,6 +6,7 @@ add-highlighter shared/sh regions
add-highlighter shared/sh/code default-region group
add-highlighter shared/sh/double_string region %{(?<!\\)(?:\\\\)*\K"} %{(?<!\\)(?:\\\\)*"} group
add-highlighter shared/sh/single_string region %{(?<!\\)(?:\\\\)*\K'} %{'} fill string
+add-highlighter shared/sh/expansion region '\$\{' '\}|\n' fill value
add-highlighter shared/sh/comment region '(?<!\$)(?<!\$\{)#' '$' fill comment
add-highlighter shared/sh/heredoc region -match-capture '<<-?''?(\w+)''?' '^\t*(\w+)$' fill string
@@ -34,7 +35,7 @@ add-highlighter shared/sh/code/operators regex [\[\]\(\)&|]{1,2} 0:operator
add-highlighter shared/sh/code/variable regex (\w+)= 1:variable
add-highlighter shared/sh/code/function regex ^\h*(\w+)\h*\(\) 1:function
-add-highlighter shared/sh/code/expansion regex \$(\w+|\{.+?\}|#|@|\?|\$|!|-|\*) 0:value
+add-highlighter shared/sh/code/unscoped_expansion regex \$(\w+|#|@|\?|\$|!|-|\*) 0:value
add-highlighter shared/sh/double_string/expansion regex \$(\w+|\{.+?\}) 0:value
hook -group sh-highlight global WinSetOption filetype=sh %{