aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2021-09-06 09:31:17 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2021-09-06 09:31:17 +0200
commit4f68f7fd92025f9934d1bab74da0c306ad81a85c (patch)
tree80cf4cebf7207b376ad3b29c6d374e269f340bda
parentf69e42a43cde36ec670d27c93a60bf316a589cec (diff)
downloadlite-xl-fix-javascript-regexp-syntax.tar.gz
lite-xl-fix-javascript-regexp-syntax.zip
Try to fix problem with js syntax of '/=' operatorfix-javascript-regexp-syntax
The operator '/=' was wrongly considered by the js syntax file as the beginning of a regexp literal. With this modification we modify the pattern for regexp literals to not match expressions starting with '/='. This doesn't seem entirely correct because apparently javascript can accept regexp literals starting with '/=' but the rule used by the javascript lexer is not known.
-rw-r--r--data/plugins/language_js.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/plugins/language_js.lua b/data/plugins/language_js.lua
index 7556b00b..bf899c41 100644
--- a/data/plugins/language_js.lua
+++ b/data/plugins/language_js.lua
@@ -7,7 +7,7 @@ syntax.add {
patterns = {
{ pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
- { pattern = { '/%g', '/', '\\' }, type = "string" },
+ { pattern = { '/[^= ]', '/', '\\' },type = "string" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
{ pattern = { "`", "`", '\\' }, type = "string" },