From 21799d1c0f998318af34615be9d365c87fedc72a Mon Sep 17 00:00:00 2001 From: Ben Larisch Date: Sun, 12 Jun 2022 10:23:04 +0200 Subject: language_go: add syntax support for Go generic functions --- plugins/language_go.lua | 5 +++-- 1 file 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", -- cgit v1.2.3