mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 01:08:59 +02:00
fix(telescope): replace anonymous functions in mappings by named functions (#1294)
This commit is contained in:
parent
74786c21d7
commit
13bf7977a4
1 changed files with 39 additions and 40 deletions
|
@ -165,48 +165,47 @@ return {
|
||||||
desc = "Goto Symbol (Workspace)",
|
desc = "Goto Symbol (Workspace)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
opts = function()
|
||||||
defaults = {
|
local actions = require("telescope.actions")
|
||||||
prompt_prefix = " ",
|
|
||||||
selection_caret = " ",
|
local open_with_trouble = function(...)
|
||||||
mappings = {
|
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||||
i = {
|
end
|
||||||
["<c-t>"] = function(...)
|
local open_selected_with_trouble = function(...)
|
||||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
||||||
end,
|
end
|
||||||
["<a-t>"] = function(...)
|
local find_files_no_ignore = function()
|
||||||
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
local action_state = require("telescope.actions.state")
|
||||||
end,
|
local line = action_state.get_current_line()
|
||||||
["<a-i>"] = function()
|
Util.telescope("find_files", { no_ignore = true, default_text = line })()
|
||||||
local action_state = require("telescope.actions.state")
|
end
|
||||||
local line = action_state.get_current_line()
|
local find_files_with_hidden = function()
|
||||||
Util.telescope("find_files", { no_ignore = true, default_text = line })()
|
local action_state = require("telescope.actions.state")
|
||||||
end,
|
local line = action_state.get_current_line()
|
||||||
["<a-h>"] = function()
|
Util.telescope("find_files", { hidden = true, default_text = line })()
|
||||||
local action_state = require("telescope.actions.state")
|
end
|
||||||
local line = action_state.get_current_line()
|
|
||||||
Util.telescope("find_files", { hidden = true, default_text = line })()
|
return {
|
||||||
end,
|
defaults = {
|
||||||
["<C-Down>"] = function(...)
|
prompt_prefix = " ",
|
||||||
return require("telescope.actions").cycle_history_next(...)
|
selection_caret = " ",
|
||||||
end,
|
mappings = {
|
||||||
["<C-Up>"] = function(...)
|
i = {
|
||||||
return require("telescope.actions").cycle_history_prev(...)
|
["<c-t>"] = open_with_trouble,
|
||||||
end,
|
["<a-t>"] = open_selected_with_trouble,
|
||||||
["<C-f>"] = function(...)
|
["<a-i>"] = find_files_no_ignore,
|
||||||
return require("telescope.actions").preview_scrolling_down(...)
|
["<a-h>"] = find_files_with_hidden,
|
||||||
end,
|
["<C-Down>"] = actions.cycle_history_next,
|
||||||
["<C-b>"] = function(...)
|
["<C-Up>"] = actions.cycle_history_prev,
|
||||||
return require("telescope.actions").preview_scrolling_up(...)
|
["<C-f>"] = actions.preview_scrolling_down,
|
||||||
end,
|
["<C-b>"] = actions.preview_scrolling_up,
|
||||||
},
|
},
|
||||||
n = {
|
n = {
|
||||||
["q"] = function(...)
|
["q"] = actions.close,
|
||||||
return require("telescope.actions").close(...)
|
},
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue