Skip to content

Commit

Permalink
fix: don't capture leading whitespace in modeline
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clason committed Mar 19, 2024
1 parent cee9888 commit 6ec0d20
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 274 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ module.exports = grammar({
),

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

// "Column heading": plaintext followed by "~".
// Intended for table column names per `:help help-writing`.
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6ec0d20

Please sign in to comment.