diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index dd990740c5..58303db639 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -1582,9 +1582,11 @@ edit({lang}) *vim.treesitter.query.edit()* 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/`. + 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/`. Parameters: ~ • {lang} (`string?`) language to open the query editor for. If omitted, diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index 246525757d..cb5d8a886f 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -608,7 +608,7 @@ local function update_editor_highlights(query_win, base_win, lang) end_col = end_col, hl_group = 'Visual', virt_text = { - { capture_name, 'Title' }, + { capture_name, 'DiagnosticVirtualTextHint' }, }, }) end 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 ` 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)