From d52c1644aa0417a5ae613ee13a8b2358d32a1ba1 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Tue, 17 Nov 2015 13:07:55 -0500 Subject: [PATCH] syntax/go: do not treat builtins as keywords builtins have a very different property from keywords, the identifiers are settable. It is perfectly valid to override the builtins, though hopefully used sparingly. Instead of using `syn keyword`, we now use `syn match` and detect a function call by searching for an open parentheses. --- syntax/go.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/go.vim b/syntax/go.vim index cf45d6040d..5d4756de14 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -117,8 +117,8 @@ syn match goDeclaration /\/ " Predefined functions and values -syn keyword goBuiltins append cap close complex copy delete imag len -syn keyword goBuiltins make new panic print println real recover +syn match goBuiltins /\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ +syn match goBuiltins /\v(make|new|panic|print|println|real|recover)\ze\(/ syn keyword goBoolean iota true false nil hi def link goBuiltins Keyword