aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_d.lua
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 /plugins/language_d.lua
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
Diffstat (limited to 'plugins/language_d.lua')
-rw-r--r--plugins/language_d.lua8
1 files changed, 3 insertions, 5 deletions
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",
},
}
-