Skip to content

Commit e074025

Browse files
committed
fix: single ' parsed as (optionlink) error
Single apostrophes are found in various :help documents such as ":help 'fillchars'". They should be treated as plaintext.
1 parent d595021 commit e074025

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

corpus/optionlink.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,40 @@ world 'hello' world
2828
(word))
2929
(word))))
3030

31+
================================================================================
32+
NOT optionlink: ' followed by whitespace
33+
================================================================================
34+
'fillchars'
35+
stl ' ' or '^' statusline
36+
wbr ' ' windowbar
37+
tricky: ' 'yes'
38+
39+
40+
--------------------------------------------------------------------------------
41+
42+
(help_file
43+
(block
44+
(line
45+
(optionlink
46+
(word)))
47+
(line
48+
(word)
49+
(word)
50+
(word)
51+
(word)
52+
(word)
53+
(word))
54+
(line
55+
(word)
56+
(word)
57+
(word)
58+
(word))
59+
(line
60+
(word)
61+
(word)
62+
(optionlink
63+
(word)))))
64+
3165
================================================================================
3266
NOT optionlink #7 #14
3367
================================================================================

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = grammar({
6262
// Explicit special cases: these are plaintext, not errors.
6363
_word_common: () => choice(
6464
// NOT optionlink: single "'".
65-
/[\t ]'[\t ]/,
65+
/'[\t ]/,
6666
// NOT optionlink: contains any non-lowercase char.
6767
seq("'", token.immediate(/[^'\n\t ]*[^'a-z\n\t ][^'\n\t ]*/), token.immediate("'")),
6868
// NOT optionlink: single char surrounded by "'".

0 commit comments

Comments
 (0)