]> Cypherpunks repositories - gostls13.git/commitdiff
misc/vim: Document better syntax sync parameter
authorGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 1 Feb 2011 00:12:45 +0000 (11:12 +1100)
committerAndrew Gerrand <adg@golang.org>
Tue, 1 Feb 2011 00:12:45 +0000 (11:12 +1100)
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
https://golang.org/cl/4029047

misc/vim/syntax/go.vim

index bef2a50c5ec828ff5072dcc752c59984a6484b57..7507cada2f86e0b85d7a4a312ccf2a12ab17b4ec 100644 (file)
@@ -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"