neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
83.64k stars 5.72k forks source link

treesitter: highlighting is wrong when hitting `o` #12817

Closed vigoux closed 4 years ago

vigoux commented 4 years ago

Steps to reproduce using nvim -u NORC

Setup treesitter highlighting for C. set formatoptions+=ro Go to a comment and hit A<Enter> or o.

Actual behaviour

The highlighting is wrong, that is : the freshly added comment is not highlighted, and the word below is highlighted.

Expected behaviour

Everything should be fine.

@bfredl I think this is related to the byte interface too

vigoux commented 4 years ago

Using the same method as in here https://github.com/neovim/neovim/issues/12645, I notice that old_byte_size is invalid here too.

vigoux commented 4 years ago

Little correction, it goes well when hitting o but not when A<CR>. Now that bytetrack is merged, I looked at the byte events, and we received wrong byte events in this case.