mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
use xmap instead of vmap in textobjects
This commit is contained in:
parent
acba0fd666
commit
c5d5e48e0f
2 changed files with 3 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ function M.attach(bufnr)
|
|||
if funcname == "init_selection" then
|
||||
mode = 'n'
|
||||
else
|
||||
mode = 'v'
|
||||
mode = 'x'
|
||||
end
|
||||
local cmd = string.format(":lua require'nvim-treesitter.incremental_selection'.%s()<CR>", funcname)
|
||||
api.nvim_buf_set_keymap(bufnr, mode, mapping, cmd, { silent = true, noremap = true })
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function M.attach(bufnr, lang)
|
|||
if query then
|
||||
local cmd = ":lua require'nvim-treesitter.textobjects.select'.select_textobject('"..query.."')<CR>"
|
||||
api.nvim_buf_set_keymap(buf, "o", mapping, cmd, {silent = true, noremap = true })
|
||||
api.nvim_buf_set_keymap(buf, "v", mapping, cmd, {silent = true, noremap = true })
|
||||
api.nvim_buf_set_keymap(buf, "x", mapping, cmd, {silent = true, noremap = true })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -47,7 +47,7 @@ function M.detach(bufnr)
|
|||
end
|
||||
if query then
|
||||
api.nvim_buf_del_keymap(buf, "o", mapping)
|
||||
api.nvim_buf_del_keymap(buf, "v", mapping)
|
||||
api.nvim_buf_del_keymap(buf, "x", mapping)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue