aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_cpp.lua
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2021-05-14 19:45:13 +0200
committerJan200101 <sentrycraft123@gmail.com>2021-05-14 19:45:13 +0200
commitc7f35e018278309257ed303a1090eb915f9e718a (patch)
treea75841dda74a72b5d47d57f7883862666c3cb0cd /plugins/language_cpp.lua
parent277036d2d0baf2d0c9982b402fd2deb21f30645c (diff)
downloadlite-xl-plugins-c7f35e018278309257ed303a1090eb915f9e718a.tar.gz
lite-xl-plugins-c7f35e018278309257ed303a1090eb915f9e718a.zip
Update C++ Language file
See https://github.com/franko/lite-xl/pull/182#issuecomment-841378446
Diffstat (limited to 'plugins/language_cpp.lua')
-rw-r--r--plugins/language_cpp.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/language_cpp.lua b/plugins/language_cpp.lua
index 4a734e0..d1656b4 100644
--- a/plugins/language_cpp.lua
+++ b/plugins/language_cpp.lua
@@ -12,7 +12,6 @@ syntax.add {
patterns = {
{ pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
- { pattern = { "#", "[^\\]\n" }, type = "comment" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
{ pattern = "-?0x%x+", type = "number" },
@@ -20,7 +19,7 @@ syntax.add {
{ pattern = "-?%.?%d+f?", type = "number" },
{ pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
- { pattern = "[%a_][%w_]*", type = "symbol" },
+ { pattern = "#[%a_][%w_]*", type = "symbol" },
},
symbols = {
["alignof"] = "keyword",
@@ -88,7 +87,7 @@ syntax.add {
["continue"] = "keyword",
["return"] = "keyword",
["goto"] = "keyword",
- ["struct"] = "keyword",
+ ["struct"] = "keyword2",
["union"] = "keyword",
["typedef"] = "keyword",
["enum"] = "keyword",
@@ -118,5 +117,16 @@ syntax.add {
["char16_t"] = "keyword2",
["char32_t"] = "keyword2",
["NULL"] = "literal",
+ ["#include"] = "keyword",
+ ["#if"] = "keyword",
+ ["#ifdef"] = "keyword",
+ ["#ifndef"] = "keyword",
+ ["#else"] = "keyword",
+ ["#elseif"] = "keyword",
+ ["#endif"] = "keyword",
+ ["#define"] = "keyword",
+ ["#warning"] = "keyword",
+ ["#error"] = "keyword",
+ ["#pragma"] = "keyword",
},
}