mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-13 19:04:36 +02:00
fix(telescope): anonymous keymap (#1879)
* fix(telescope): anonymous keymap * fix(telescope): add desc * fix(telescope): function name * fix(telescope): update description * fix(telescope): diagnostic disable
This commit is contained in:
parent
ddbba85408
commit
36ae4213b8
1 changed files with 10 additions and 8 deletions
|
@ -36,16 +36,18 @@ function M.telescope(builtin, opts)
|
|||
end
|
||||
end
|
||||
if opts.cwd and opts.cwd ~= vim.loop.cwd() then
|
||||
local function open_cwd_dir()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
M.telescope(
|
||||
params.builtin,
|
||||
vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line })
|
||||
)()
|
||||
end
|
||||
---@diagnostic disable-next-line: inject-field
|
||||
opts.attach_mappings = function(_, map)
|
||||
map("i", "<a-c>", function()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
M.telescope(
|
||||
params.builtin,
|
||||
vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line })
|
||||
)()
|
||||
end)
|
||||
-- opts.desc is overridden by telescope, until it's changed there is this fix
|
||||
map("i", "<a-c>", open_cwd_dir, { desc = "Open cwd directory" })
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue