diff options
| author | Michele Campeotto <micampe@micampe.it> | 2026-02-12 14:07:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-12 08:07:13 -0500 |
| commit | d0822bbd155796bd04c0ef1fdf051e90a09fa0a7 (patch) | |
| tree | de2cebeb6021ff0b23dc3fca21334125fb2e2b10 /runtime/lua/vim/treesitter/query.lua | |
| parent | fd69b7111912ae5ccb01327b130f582be23e44dc (diff) | |
| download | rneovim-d0822bbd155796bd04c0ef1fdf051e90a09fa0a7.tar.gz rneovim-d0822bbd155796bd04c0ef1fdf051e90a09fa0a7.tar.bz2 rneovim-d0822bbd155796bd04c0ef1fdf051e90a09fa0a7.zip | |
fix(treesitter): highlight group for EditQuery captures #36265
fix(treesitter): more distinctive highlight for EditQuery captures
Problem: EditQuery shows captures in the source buffer using the Title
highlight group, which could be too similar to Normal.
Solution: Use a virtual text diagnostic highlight group: they are
displayed in a similar manner to the query captures so we can assume
that the color scheme should have appropriate styling applied to make
them visible.
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
| -rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index cdb29fdb61..cd217e6ab2 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -1196,9 +1196,11 @@ end --- Can also be shown with the [:EditQuery]() command. `:EditQuery <tab>` completes available --- parsers. --- ---- If you move the cursor to a capture name ("@foo"), text matching the capture is highlighted in ---- the source buffer. The query editor is a scratch buffer, use `:write` to save it. You can find ---- example queries at `$VIMRUNTIME/queries/`. +--- If you move the cursor to a capture name ("@foo"), text matching the capture is highlighted +--- with |hl-DiagnosticVirtualTextHint| in the source buffer. +--- +--- The query editor is a scratch buffer, use `:write` to save it. You can find example queries +--- at `$VIMRUNTIME/queries/`. --- --- @param lang? string language to open the query editor for. If omitted, inferred from the current buffer's filetype. function M.edit(lang) |