Skip to content

Commit 6ec0d20

Browse files
committed
fix: don't capture leading whitespace in modeline
Problem: Including leading whitespace in modeline leads (somehow) to leading whitespace being included in other nodes, especially `taglink`, and thus concealed. This breaks right-aligned taglinks in Neovim documentation. Solution: Do not include whitespace in modeline.
1 parent cee9888 commit 6ec0d20

File tree

4 files changed

+280
-274
lines changed

4 files changed

+280
-274
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ module.exports = grammar({
171171
),
172172

173173
// Modeline: must start with "vim:" (optionally preceded by whitespace)
174-
modeline: ($) => token(prec(2, /[\t ]*vim:[^\n]+\n/)),
174+
modeline: ($) => token(prec(2, /vim:[^\n]+\n/)),
175175

176176
// "Column heading": plaintext followed by "~".
177177
// Intended for table column names per `:help help-writing`.

src/grammar.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)