Skip to content

Commit 1c47961

Browse files
liskinjbodah
authored andcommitted
syntax: Prevent syntax/javascript.vim from overriding our syn sync
Unfortunately the main_syntax trick doesn't prevent javascript.vim from doing syn sync fromstart. This is most likely a bug in javascript.vim and I'll submit a pull request to vim to fix this. Luckily setting main_syntax does prevent javascript.vim from introducing its own syncing rules, it just overrides minlines and maxlines, so we can work around it by moving the syn sync minlines to the end.
1 parent c936563 commit 1c47961

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

syntax/elixir.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ endif
88
let s:cpo_save = &cpo
99
set cpo&vim
1010

11-
" syncing starts 2000 lines before top line so docstrings don't screw things up
12-
syn sync minlines=2000
13-
1411
syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition,elixirUnusedVariable,elixirStructDelimiter
1512
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
1613
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
@@ -175,6 +172,9 @@ syn match elixirExUnitMacro "\C\(^\s*\)\@<=\<\(test\|describe\|setup\|setup_all
175172
syn match elixirExUnitAssert "\C\(^\s*\)\@<=\<\(assert\|assert_in_delta\|assert_raise\|assert_receive\|assert_received\|catch_error\)\>"
176173
syn match elixirExUnitAssert "\C\(^\s*\)\@<=\<\(catch_exit\|catch_throw\|flunk\|refute\|refute_in_delta\|refute_receive\|refute_received\)\>"
177174

175+
" syncing starts 2000 lines before top line so docstrings don't screw things up
176+
syn sync minlines=2000
177+
178178
hi def link elixirBlockDefinition Define
179179
hi def link elixirDefine Define
180180
hi def link elixirPrivateDefine Define

0 commit comments

Comments
 (0)