-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
column_header when tilde is not preceded by space #94
Comments
Vimhelp is woefully underspecified... The only full documentation is On the other hand, this parser is opinionated: If there are multiple valid ways, it will in general only try to support one. In this case, it (for technical reasons) requires a space before the tilde, so the following does work:
|
Expanding on the technical reason: As this parser does not use an external scanner, it relies on whitespace for separating tokens, so this limitation is by design. |
In the README, it says: - `column_heading` currently only recognizes tilde `~` preceded by space (i.e.
`foo ~` not `foo~`). This covers 99% of :help files. The "currently" seems to indicate that the limitation may be relaxed in the future. I would propose to either
|
I can't speak for @justinmk's plans, but as far as I can tell, this is not a limitation that can be addressed without a massive redesign -- it's not just a 't' that was forgotten to be crossed... At least from the POV of Neovim itself, the official policy in such cases is to simply change the help files to conform to the stricter spec. This is also the very first sentence of the README... |
Thanks; I'll wait for @justinmk to reply. I don't mind adhering to stricter conventions, of course. But the "currently" in the README makes it sound like this is going to change in the future. If it (most likely) isn't, then it would be easier as a plugin author to adjust accordingly :) (I probably will now, anyway, but still.) |
One of my secret hopes is that this parser will eventually serve as an actual, complete, and unambiguous specification for the "help grammar" to make it easier to write -- and generate from other formats like docstrings or Markdown... |
Not really interested in litigating the presence of "currently", but the readme also mentions:
Anyhoo, improvements are welcome if they don't lead to insane complexity, but otherwise this is likely to remain a "known issue". |
Thanks; I'll update help files I'm responsible for accordingly. |
One step closer to enabling tree-sitter highlighting for help files by default :) |
Hehe, I actually already did. Which explains why I opened this issue in the first place; the implication being that I found the tree-sitter highlighting now solid enough to scratch the legacy version. |
The Tree-sitter version of the help filetype
does not currently support the "column heading" itemhas a known limitation for handling the column header item. This item is documented in:help help-writing
just before:help help-codeblock
:(Btw.: I actually believe there may be a slight bug in the help file here, as I think the example should contain the tilde character.)
If the tilde does not have a preceding space, the current parser does not recognize it. So, the following syntax with old style syntax rules
Should look something like this (depending on color scheme and so on):
Edit: I'm sorry, I just realized this was mentioned as a current limitation here. So, if I add a preceding space to the tilde, then it will be parsed correctly. Perhaps this issue then can remain open for handling the case without preceding space? I've reworded it to make it more clear.
The text was updated successfully, but these errors were encountered: