neovim / tree-sitter-vimdoc

Tree-sitter parser for Vim help files

Repository from Github https://github.comneovim/tree-sitter-vimdocRepository from Github https://github.comneovim/tree-sitter-vimdoc

backtick( and backtick{ start inline code block

xian-wen opened this issue · comments

Sorry, if this is a duplicate of any other issues, forgive me, please. Thank you so much.
Problem
On the latest stable Neovim, the help.txt file does not highlight correctly. Especially for characters following ` (single backtick), all are highlighted just like a comment starting from the open backtick to the end of line.
See the details here neovim/neovim#30930.

sample text:

							*'(* *`(*
'(  `(			To the start of the current sentence, like the |(|
			command.

							*')* *`)*
')  `)			To the end of the current sentence, like the |)|
			command.

							*'{* *`{*
'{  `{			To the start of the current paragraph, like the |{|
			command.

							*'}* *`}*
'}  `}			To the end of the current paragraph, like the |}|
			command.

I am not sure this is worth "fixing" but can track it here for now. The parser is doing the correct thing for this help text.

related:

Thank you so much for the modification. In fact, it is not only backtick( and backtick{, it is backtick(mark). Any marks (expect the backtick mark itself) following backtick have the same issue. See :h motion.txt.

Yes, I don't think this can be solved without lookahead (i.e., an external scanner). It's usually better to rewrite the docs to avoid these situations (e.g., use quotes).

In fact, it is not only backtick( and backtick{, it is backtick(mark). Any marks following backtick have the same issue. See :h motion.txt.

Duplicate of #113