summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2011-02-01 11:12:45 +1100
committerGustavo Niemeyer <gustavo@niemeyer.net>2011-02-01 11:12:45 +1100
commit9e5fd228e24343b35e0ea5d54fc4a5ecb0bf4a38 (patch)
treef3d08f979364953f48e100221fbb84aa99c53619
parent257a4fe0daa54a6466356ca4e4c534d482ff2bda (diff)
downloadgo-9e5fd228e24343b35e0ea5d54fc4a5ecb0bf4a38.tar.gz
misc/vim: Document better syntax sync parameter
Forcing the synchronization of 500 lines is both slower and less precise than searching for a known sync point. Unfortunately, though, the way to synchronize correctly is using the grouphere instruction, which has a bug. I've already proposed the fix to Vim, so future releases should have this working. We can continue using the 500 lines syncing for now. This change just documents the proper way to sync. R=adg, dsymonds CC=golang-dev http://codereview.appspot.com/4029047 Committer: Andrew Gerrand <adg@golang.org>
-rw-r--r--misc/vim/syntax/go.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/vim/syntax/go.vim b/misc/vim/syntax/go.vim
index bef2a50c5..7507cada2 100644
--- a/misc/vim/syntax/go.vim
+++ b/misc/vim/syntax/go.vim
@@ -198,6 +198,11 @@ endif
hi def link goExtraType Type
hi def link goSpaceError Error
+" Search backwards for a global declaration to start processing the syntax.
+"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
+
+" There's a bug in the implementation of grouphere. For now, use the
+" following as a more expensive/less precise workaround.
syn sync minlines=500
let b:current_syntax = "go"