fix telescope
This commit is contained in:
parent
f483bd632c
commit
d49cf6e3ad
1 changed files with 22 additions and 21 deletions
|
|
@ -35,27 +35,28 @@
|
|||
# │ │ Preview │ │
|
||||
# │ └────────────────────────────────────────┘ │
|
||||
# └──────────────────────────────────────────────────┘
|
||||
# extraConfigLuaPre = ''
|
||||
# local TelescopeWithTheme = function(fn, args, extension)
|
||||
# args.layout_config = {
|
||||
# anchor = "N",
|
||||
# mirror = true,
|
||||
# width = 0.8,
|
||||
# }
|
||||
#
|
||||
# if fn == "keymaps" or fn == "registers" then args.layout_config.height = function(_, _, max_lines) return max_lines end end
|
||||
#
|
||||
# local args_with_theme = require("telescope.themes").get_dropdown(args)
|
||||
#
|
||||
# if extension ~= "" then
|
||||
# require("telescope").extensions[extension][fn](args_with_theme)
|
||||
# else
|
||||
# require("telescope.builtin")[fn](args_with_theme)
|
||||
# end
|
||||
# end
|
||||
# '';
|
||||
extraConfigLuaPre = ''
|
||||
local telescopeWithArgs = function(fn, args, extension)
|
||||
-- args.layout_config = {
|
||||
-- anchor = "N",
|
||||
-- mirror = true,
|
||||
-- width = 0.8,
|
||||
-- }
|
||||
|
||||
-- if fn == "keymaps" or fn == "registers" then args.layout_config.height = function(_, _, max_lines) return max_lines end end
|
||||
|
||||
-- local args_with_theme = require("telescope.themes").get_dropdown(args)
|
||||
local args_with_theme = args
|
||||
|
||||
# Use root keymaps to allow usage of custom TelescopeWithTheme function
|
||||
if extension ~= "" then
|
||||
require("telescope").extensions[extension][fn](args_with_theme)
|
||||
else
|
||||
require("telescope.builtin")[fn](args_with_theme)
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
# Use root keymaps to allow usage of custom telescopeWithArgs function
|
||||
keymaps =
|
||||
let
|
||||
mkTelescopeKeymap =
|
||||
|
|
@ -68,7 +69,7 @@
|
|||
}: {
|
||||
inherit key mode;
|
||||
|
||||
action.__raw = "function() TelescopeWithTheme('${fn}', ${helpers.toLuaObject args}, '${builtins.toString extension}') end";
|
||||
action.__raw = "function() telescopeWithArgs('${fn}', ${helpers.toLuaObject args}, '${builtins.toString extension}') end";
|
||||
options = { inherit desc; };
|
||||
};
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue