diff options
author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-10-08 13:33:23 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-10-08 13:33:23 +0200 |
commit | b53c5eb773b9fd3bd0ea277fe60e2129778cfdb5 (patch) | |
tree | 0ca9c679bdfda817ea82ed7edabf6cdc8252577e /plugins/language_sh.lua | |
parent | 051d5662bef34d67d5f16d21fa174f74e209adf0 (diff) | |
download | lite-xl-plugins-b53c5eb773b9fd3bd0ea277fe60e2129778cfdb5.tar.gz lite-xl-plugins-b53c5eb773b9fd3bd0ea277fe60e2129778cfdb5.zip |
Fix language_sh to recognize 0 bash variable
Diffstat (limited to 'plugins/language_sh.lua')
-rw-r--r-- | plugins/language_sh.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/language_sh.lua b/plugins/language_sh.lua index f21557d..9159f3b 100644 --- a/plugins/language_sh.lua +++ b/plugins/language_sh.lua @@ -6,6 +6,9 @@ syntax.add { headers = "^#!.*bin.*sh\n", comment = "#", patterns = { + -- $# is a bash special variable and the '#' shouldn't be interpreted + -- as a comment. + { pattern = "$[%a_@*#][%w_]*", type = "keyword2" }, { pattern = "#.*\n", type = "comment" }, { pattern = [[\.]], type = "normal" }, { pattern = { '"', '"', '\\' }, type = "string" }, @@ -15,7 +18,6 @@ syntax.add { { pattern = "[!<>|&%[%]=*]", type = "operator" }, { pattern = "%f[%S]%-[%w%-_]+", type = "function" }, { pattern = "${.-}", type = "keyword2" }, - { pattern = "$[%a_@*][%w_]*", type = "keyword2" }, { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { |