diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-09-20 04:15:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 04:15:23 -0700 |
commit | 1b55f51d0d8468ca357514a868ac8e188b0c8722 (patch) | |
tree | 7212864dc2bcaa4ff2e6123620d6596692826509 /runtime/lua/vim/treesitter | |
parent | 50d5fcc0bc1a3a67b9c3cc7066d97593ea3cc22d (diff) | |
download | rneovim-1b55f51d0d8468ca357514a868ac8e188b0c8722.tar.gz rneovim-1b55f51d0d8468ca357514a868ac8e188b0c8722.tar.bz2 rneovim-1b55f51d0d8468ca357514a868ac8e188b0c8722.zip |
docs: misc #24561
fix #24699
fix #25253
Diffstat (limited to 'runtime/lua/vim/treesitter')
-rw-r--r-- | runtime/lua/vim/treesitter/dev.lua | 5 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index 7f24ba8590..61d84017d4 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -597,8 +597,9 @@ function M.edit_query(lang) }) api.nvim_buf_set_lines(query_buf, 0, -1, false, { - ';; Write your query here. Use @captures to highlight matches in the source buffer.', - ';; Completion for grammar nodes is available (see :h compl-omni)', + ';; Write queries here (see $VIMRUNTIME/queries/ for examples).', + ';; Move cursor to a capture ("@foo") to highlight matches in the source buffer.', + ';; Completion for grammar nodes is available (:help compl-omni)', '', '', }) diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index 44ed37d64e..313d837d5c 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -843,11 +843,13 @@ function M.omnifunc(findstart, base) return require('vim.treesitter._query_linter').omnifunc(findstart, base) end ---- Open a window for live editing of a treesitter query. +--- Opens a live editor to query the buffer you started from. --- ---- Can also be shown with `:EditQuery`. *:EditQuery* +--- Can also be shown with *:EditQuery*. --- ---- Note that the editor opens a scratch buffer, and so queries aren't persisted on disk. +--- 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/`. --- --- @param lang? string language to open the query editor for. If omitted, inferred from the current buffer's filetype. function M.edit(lang) |