mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(telescope): anonymous keymap
This commit is contained in:
parent
7831fc94ca
commit
e7c696c60e
1 changed files with 9 additions and 8 deletions
|
|
@ -33,15 +33,16 @@ function M.telescope(builtin, opts)
|
||||||
end
|
end
|
||||||
if opts.cwd and opts.cwd ~= vim.loop.cwd() then
|
if opts.cwd and opts.cwd ~= vim.loop.cwd() then
|
||||||
---@diagnostic disable-next-line: inject-field
|
---@diagnostic disable-next-line: inject-field
|
||||||
opts.attach_mappings = function(_, map)
|
local function open_git_root()
|
||||||
map("i", "<a-c>", function()
|
|
||||||
local action_state = require("telescope.actions.state")
|
local action_state = require("telescope.actions.state")
|
||||||
local line = action_state.get_current_line()
|
local line = action_state.get_current_line()
|
||||||
M.telescope(
|
M.telescope(
|
||||||
params.builtin,
|
params.builtin,
|
||||||
vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line })
|
vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line })
|
||||||
)()
|
)()
|
||||||
end)
|
end
|
||||||
|
opts.attach_mappings = function(_, map)
|
||||||
|
map("i", "<a-c>", open_git_root)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue