Skip to content

Commit 2a35ceb

Browse files
committed
Fix incorrect reading of Emacs modelines
1 parent 8c54c18 commit 2a35ceb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

grammars/viml.cson

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ firstLineMatch: """(?x)
2828
|
2929
3030
# Emacs modeline, assuming a major mode for VimScript even exists
31-
-\\*-(?:(?:(?!mode\\s*:)[^:;]+:[^:;]+;)*\\s*mode\\s*:)?\\s*
32-
(Vim|VimL|VimScript)
33-
\\s*(?:;[^:;]+:[^:;]+?)*;?\\s*-\\*-
31+
-\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)
32+
(?:Vim|VimL|VimScript)
33+
(?=[\\s;]|(?<![-*])-\\*-).*?-\\*-
3434
)
3535
"""
3636
foldingStartMarker: "^(?:if|while|for|fu|function|augroup|aug)"

0 commit comments

Comments
 (0)