zed icon indicating copy to clipboard operation
zed copied to clipboard

Vim: Syntax highlighting glitch and slow behavior with [[

Open farbodvand opened this issue 10 months ago • 0 comments

Summary

When using the "Go to next" shortcut ([[) in Vim mode (https://zed.dev/docs/vim#treesitter), some parts of the syntax highlighting become plain text as it reaches the start or end of the file (look app.js). Additionally, in certain cases (look index.d.ts), the text glitches.

At the end of the demo, I showed that using Shift + { (to move between blocks) does not trigger this glitch. Also, the [[ shortcut is noticeably slower compared to Shift + {.

Both issues are demonstrated in the video below:

Video

https://github.com/user-attachments/assets/36118a1f-e3f2-4f00-b007-188b26876997

Steps to reproduce:

  1. Open a language file with LSP support.
  2. Enter Vim normal mode.
  3. Press [[ to navigate forward through the file until you reach the start or end.

Expected Behavior:

  • Syntax highlighting should remain intact during navigation.
  • The [[ shortcut should perform at the same speed as Shift + {.

Actual Behavior:

  • Syntax highlighting glitches or turns into plain text in some cases.
  • [[ navigation is slower than Shift + {.

Zed Version and System Specs

Zed: v0.184.8 (Zed) OS: macOS 15.4.1 Memory: 16 GiB Architecture: x86_64

farbodvand avatar May 01 '25 12:05 farbodvand