Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Highlighting seems broken #45

Open
arafatamim opened this issue Jan 12, 2022 · 11 comments · Fixed by #95
Open

Highlighting seems broken #45

arafatamim opened this issue Jan 12, 2022 · 11 comments · Fixed by #95

Comments

@arafatamim
Copy link

It looks like the syntax highlighting in some parts of the file got messed up. Changing the color scheme doesn't fix it, and I've no idea if this was caused by an update or another plugin. Here are some examples:

image
image
image

I'm running the release Neovim version 0.6.0-1 on Linux.

@Fymyte
Copy link
Collaborator

Fymyte commented Jan 12, 2022

If you have treesitter playground, you should check the tree but I am pretty sure it is due to some parsing errors (due
to this parser and not your file).
I don't think the colon are supported in autocmd (again just on this parser) and that's probably the issue with the
first file.

@vigoux
Copy link
Owner

vigoux commented Jan 13, 2022

The colon seems to be a problem indeed.
I am going to add some checks for that and correctly support it.

@heralden
Copy link

I have noticed some oddities as well:

Here filetype breaks the highlighting.

2022-01-15-154615_250x120_scrot

Here colorscheme breaks the highlighting.

2022-01-15-154638_414x75_scrot

@Fymyte
Copy link
Collaborator

Fymyte commented Jan 17, 2022

@vigoux Do you think you can add those issues in the project todos ? I really like the parser and want to help and I think having a nice organized list of things would help me a lot to know from where to start.

@vigoux
Copy link
Owner

vigoux commented Jan 18, 2022

Yep, I can do that.
Could you join the nvim-treesitter Zulip so that we can chat together too @Fymyte ?

@Fymyte
Copy link
Collaborator

Fymyte commented Feb 1, 2022

For a quick follow up, support for colon before command has been added in commit 3b69c99

@BlueDrag0n
Copy link

Hello,

I've have the same problem when it comes to highlighting:

image

image

@vigoux
Copy link
Owner

vigoux commented Apr 1, 2022

This should have been fixed in latest master.
I'll be adding a few test cases just to be sure.

@jdrouhard
Copy link

@BlueDrag0n Most built-in vim commands aren't understood by the parser yet. Most of the tab, buffer, window, and tag related commands aren't understood (like :tabn[ext] :tabp[revious] :bn[ext] :bp[rev] :sp[lit] :vert[ical] etc).

@vigoux Is this something that's on your radar? Do you think the parser should explicitly support every known built-in command or should there be a "fallback" rule that will match :[a-zA-Z0-9]+ and assume there are no args if its not a command explicitly supported?

@vigoux
Copy link
Owner

vigoux commented Apr 5, 2022

That's a good question.
In an earlier version, the parser parsed unknown commands as some kind of "default" command with "sane" parsing.

Unfortunately, nothing is simple with VimL, and it ended up not working at all in most cases, leading to messed up ASTs in many cases.

That was a long time ago though, so it might be good to reconsider this, so that we make integration of the parser easier for the end users.

@vigoux
Copy link
Owner

vigoux commented Aug 23, 2022

vertical has been added in latest master.

We still miss buffer and tab related commands.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants