Skip to content
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

HTML tags indentation doesn't work correctly in nvim #68

Open
greg-grigorjevs opened this issue Aug 5, 2024 · 1 comment
Open

HTML tags indentation doesn't work correctly in nvim #68

greg-grigorjevs opened this issue Aug 5, 2024 · 1 comment

Comments

@greg-grigorjevs
Copy link

So when I am in an html file and I have something like this <div>|</div> and I press enter it expands to this:

<div>
    |
</div>

but when I am in a blade file the same action expands to this:

<div>
|</div>

At the same time when if I put the cursor here:

<div>|
</div>

It expands correctly to this:

<div>
    |
</div>

And it also expands correctly if I press o/O in normal mode

I have already tried copy-pasting the contents of https://github.com/nvim-treesitter/nvim-treesitter/blob/1aad04ecde5ebf8f2b3eea5c6f39d38b251757f5/queries/html_tags/indents.scm into after/queries/blade/indents.scm and indent is enabled inside my treesitter config but that didn't change anything.

Does anyone has the same issue ?

@EmranMR
Copy link
Owner

EmranMR commented Aug 31, 2024

Hi, so I just tried this in helix, and this is also the case there. wonder if this is the case in other languages that inject html. So I am not sure if this is the issue with this parser or it is just the way tree-sitter handles things. For example, the text editors have a hard time, where you use the shortcut for comments. They inject html comments, even if the blade comments are fully configured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants