Skip to content

fix: attach when filetype has been set#664

Merged
lewis6991 merged 1 commit intonvim-treesitter:masterfrom
tronikelis:fix/attach_when_ft_changes
Apr 2, 2026
Merged

fix: attach when filetype has been set#664
lewis6991 merged 1 commit intonvim-treesitter:masterfrom
tronikelis:fix/attach_when_ft_changes

Conversation

@tronikelis
Copy link
Copy Markdown
Contributor

Problem

When opening nvim with a buffer that has no backing file e.g. nvim <(curl example.com) and/or when buffer has no filetype, context does not show which is good, however, when changing filetype with set ft=lang nvim-treesitter-context stays unattached.

I first initially ran into this when doing nvim <large.json and saw that no context was being displayed after I did set ft=json

Solution

Try to attach on FileType as well.


I confirmed this fixes the problem stated above with set ft=<lang>

@lewis6991
Copy link
Copy Markdown
Member

Seems reasonable.

@lewis6991 lewis6991 merged commit b0c45ce into nvim-treesitter:master Apr 2, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants