fix telescope

This commit is contained in:
MFlossmann 2024-07-13 08:37:13 +02:00
parent f483bd632c
commit d49cf6e3ad

View file

@ -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