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

Undo leads to markdown highlight failure. #29482

Open
yuukibarns opened this issue Jun 25, 2024 · 1 comment
Open

Undo leads to markdown highlight failure. #29482

yuukibarns opened this issue Jun 25, 2024 · 1 comment
Labels
bug issues reporting wrong behavior treesitter

Comments

@yuukibarns
Copy link

Problem

q.mp4

Steps to reproduce

Here is my minimal config:

local path = vim.fn.stdpath("data") .. "/nvim-treesitter"
vim.opt.rtp:prepend(path)

require("nvim-treesitter.configs").setup({
	ensure_installed = {
		"markdown",
		"markdown_inline",
		"latex",
	},
	highlight = { enable = true },
})

vim.opt.smoothscroll = false

vim.opt.smoothscroll = false is to ensure that smoothscroll doesn't make any difference.

Here is my .md file used in the video.
q.md

My operation in the video is

  1. G to the bottom
  2. o to open a new line and input some a
  3. undo the last operation
  4. navigate back to the top and find highlight of first two lines fails
  5. input a and find highlight is restored.

Expected behavior

The first two lines should be highlight properly after undo.

Neovim version (nvim -v)

NVIM v0.10.0

Vim (not Nvim) behaves the same?

I don't know, I think the nvim-treesitter plugin is for neovim only.

Operating system/version

Windows 11 Home China

Terminal name/version

PowerShell 7.4.3

$TERM environment variable

I think it is not important.

Installation

nvim-win64.zip

@yuukibarns
Copy link
Author

It is quite strange that I can't reproduce the problem every time I do the same operation as in the video.
But maybe you can try to undo more times with the first two line out of the buffer, and try to quit and reopen the file, the problem may arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior treesitter
Projects
None yet
Development

No branches or pull requests

2 participants