diff options
author | Ben Larisch <benlarisch2019@gmail.com> | 2022-06-12 10:23:04 +0200 |
---|---|---|
committer | Ben Larisch <benlarisch2019@gmail.com> | 2022-06-12 10:23:04 +0200 |
commit | 21799d1c0f998318af34615be9d365c87fedc72a (patch) | |
tree | d79804cbbe11ab879843ca64df9cd42d79ce646e /plugins | |
parent | ac2e5251fdf4feed9e97a619f525abd8179c0512 (diff) | |
download | lite-xl-plugins-21799d1c0f998318af34615be9d365c87fedc72a.tar.gz lite-xl-plugins-21799d1c0f998318af34615be9d365c87fedc72a.zip |
language_go: add syntax support for Go generic functions
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_go.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/language_go.lua b/plugins/language_go.lua index e1c96b2..0532784 100644 --- a/plugins/language_go.lua +++ b/plugins/language_go.lua @@ -18,7 +18,8 @@ syntax.add { { pattern = "-?%.?%d+f?", type = "number" }, { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, { pattern = ":=", type = "operator" }, - { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- function call + { pattern = "func()[%s].*[%a_][%w_]*()%f[%[(]", type = {"keyword", "function", "normal"} }, -- function statement { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { @@ -35,8 +36,8 @@ syntax.add { ["const"] = "keyword", ["package"] = "keyword", ["import"] = "keyword", - ["func"] = "keyword", ["var"] = "keyword", + ["func"] = "keyword", ["type"] = "keyword", ["interface"] = "keyword", ["select"] = "keyword", |