Skip to content

On help pages, "<" not concealed when followed by " - " #146

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

Open
dstein64 opened this issue Apr 7, 2025 · 8 comments
Open

On help pages, "<" not concealed when followed by " - " #146

dstein64 opened this issue Apr 7, 2025 · 8 comments
Labels
documentation Improvements or additions to documentation

Comments

@dstein64
Copy link

dstein64 commented Apr 7, 2025

Problem

On help pages with code, "<" is not concealed when followed by " - ".

This started at the following Neovim commit: 095bd8d.

Steps to reproduce

nvim --clean

Create a file with the following content:

text >
 let x = 0
< - text

Then run:

:set ft=help

Expected behavior

Expected (no "<"):

text
 let x = 0
 - text

Actual (includes "<"):

text
 let x = 0
< - text

(the problem is gone if "- text" is changed to "-text" or "text")

Nvim version (nvim -v)

v0.11.0

Vim (not Nvim) behaves the same?

No

Operating system/version

Kubuntu 24.04

Terminal name/version

Konsole 23.08.5

$TERM environment variable

xterm-256color

Installation

appimage

@clason
Copy link
Member

clason commented Apr 7, 2025

Why are you expecting this to work?

@dstein64
Copy link
Author

dstein64 commented Apr 7, 2025

"Why are you expecting this to work?"

The example matches the format described under :help help-codeblock. There's nothing in the documentation that suggests that "<" shouldn't be followed by " - ".

@clason
Copy link
Member

clason commented Apr 7, 2025

So you're reporting an issue with the vimdoc parser. (Which is wontfix. We are more strict with syntax.)

@clason clason added the documentation Improvements or additions to documentation label Apr 7, 2025
@dstein64
Copy link
Author

dstein64 commented Apr 7, 2025

"Which is wontfix. We are more strict with syntax."

In that case, helphelp.txt (which has the aforementioned help-codeblock) wouldn't be the only help document requiring updates.

The help pages ft_sql.txt and insert.txt are currently depending on "<" ending a code block even when followed by " - " (although for insert.txt, "<" is followed by "-" without a leading space, which is presumably unintentional).

@clason
Copy link
Member

clason commented Apr 7, 2025

Again, these are upstream docs which we don't tend to touch without very good reason.

@justinmk justinmk transferred this issue from neovim/neovim Apr 8, 2025
@dstein64
Copy link
Author

dstein64 commented Apr 8, 2025

This is related to (or could be the same issue as) #118.

@clason
Copy link
Member

clason commented Apr 8, 2025

Yes, that is related. The parser relies on whitespace for tokenization (since it doesn't use an external scanner), and lists are difficult to detect if you can't rely on isolation.

Instead, the policy so far has been "just write better docs smh".

@justinmk
Copy link
Member

justinmk commented Apr 9, 2025

Maybe it's feasible for the grammar to let \s*- terminate a codeblock.

dstein64 added a commit to dstein64/nvim-scrollview that referenced this issue Apr 11, 2025
This allows "<" to be concealed in the documentation (specifically the
documentation for working around scrollbar floating windows being
included in the window count returned by winnr('$')).

See the following pages for more details on the issue.

- neovim/tree-sitter-vimdoc#146
- neovim/tree-sitter-vimdoc#118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants