neovim / tree-sitter-vimdoc

Tree-sitter parser for Vim help files
Apache License 2.0
103 stars 13 forks source link

fix: errors from single ' or | #31

Closed justinmk closed 2 years ago

justinmk commented 2 years ago

Problem:

  1. single ' causes errors, it should be plaintext
  2. single | causes errors, it should be plaintext

Solution: Remove explicit whitespace patterns from the related $.word patterns. This also fixes https://github.com/neovim/tree-sitter-vimdoc/issues/23 because it turns out that defining a $.word choice that captures (leading) whitespace causes treesitter to include whitespace in all/most nodes in the tree?