mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Support query table in treesitter-textobjects mappings
This commit is contained in:
parent
064e61058b
commit
3e48f834c5
1 changed files with 8 additions and 2 deletions
|
|
@ -171,8 +171,14 @@ return {
|
|||
|
||||
for method, keymaps in pairs(moves) do
|
||||
for key, query in pairs(keymaps) do
|
||||
local desc = query:gsub("@", ""):gsub("%..*", "")
|
||||
desc = desc:sub(1, 1):upper() .. desc:sub(2)
|
||||
local queries = type(query) == "table" and query or { query }
|
||||
local parts = {}
|
||||
for _, q in ipairs(queries) do
|
||||
local part = q:gsub("@", ""):gsub("%..*", "")
|
||||
part = part:sub(1, 1):upper() .. part:sub(2)
|
||||
table.insert(parts, part)
|
||||
end
|
||||
local desc = table.concat(parts, " or ")
|
||||
desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc
|
||||
desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start")
|
||||
if not (vim.wo.diff and key:find("[cC]")) then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue