aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamnac <49466795+Tamnac@users.noreply.github.com>2023-08-08 16:56:55 -0700
committerGitHub <noreply@github.com>2023-08-08 19:56:55 -0400
commiteef65c9d6a0c65dd23b9e4b4473d709218e55b39 (patch)
tree9f054b22ab9b02a2cfe737483fd255e816e20709
parent9daf9eb7d783360c861ebab01bf42812e0410d7e (diff)
downloadlite-xl-plugins-eef65c9d6a0c65dd23b9e4b4473d709218e55b39.tar.gz
lite-xl-plugins-eef65c9d6a0c65dd23b9e4b4473d709218e55b39.zip
Dlang: allow underscores for numbers and improve function matching (#275)
* Dlang: allow underscores for numbers and improve function matching * Update version in manifest
-rw-r--r--manifest.json2
-rw-r--r--plugins/language_d.lua8
2 files changed, 4 insertions, 6 deletions
diff --git a/manifest.json b/manifest.json
index e21e8b9..320f1bb 100644
--- a/manifest.json
+++ b/manifest.json
@@ -447,7 +447,7 @@
},
{
"description": "Syntax for the [D](https://dlang.org/) programming language",
- "version": "0.1",
+ "version": "0.2",
"path": "plugins/language_d.lua",
"id": "language_d",
"mod_version": "3"
diff --git a/plugins/language_d.lua b/plugins/language_d.lua
index 6788f0b..282c026 100644
--- a/plugins/language_d.lua
+++ b/plugins/language_d.lua
@@ -12,12 +12,11 @@ syntax.add {
{ pattern = { '`', '`', '\\' }, type = "string" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
- { pattern = "-?0x%x+", type = "number" },
- { pattern = "-?%d+[%d%.eE]*f?", type = "number" },
+ { pattern = "-?0x[%x_]+", type = "number" },
+ { pattern = "-?[%d_]+[%d%.eE]*f?", type = "number" },
{ pattern = "-?%.?%d+f?", type = "number" },
{ pattern = "[%+%-=/%*%^%%<>!~|&%$]+", type = "operator" },
- { pattern = "[%a_][%w_]*!", type = "function" }, -- highlight templates
- { pattern = "[%a_][%w_]*", type = "symbol" },
+ { pattern = "[%a_][%w_]*!?()[%(.]", type = {"function", "normal"} }, -- highlight templates
{ pattern = "@safe", type = "keyword" },
{ pattern = "@trusted", type = "keyword" },
{ pattern = "@nogc", type = "keyword" },
@@ -134,4 +133,3 @@ syntax.add {
["__parameters"] = "keyword",
},
}
-