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 │ │ # │ │ Preview │ │
# │ └────────────────────────────────────────┘ │ # │ └────────────────────────────────────────┘ │
# └──────────────────────────────────────────────────┘ # └──────────────────────────────────────────────────┘
# extraConfigLuaPre = '' extraConfigLuaPre = ''
# local TelescopeWithTheme = function(fn, args, extension) local telescopeWithArgs = function(fn, args, extension)
# args.layout_config = { -- args.layout_config = {
# anchor = "N", -- anchor = "N",
# mirror = true, -- mirror = true,
# width = 0.8, -- 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
# '';
# Use root keymaps to allow usage of custom TelescopeWithTheme function -- 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
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 = keymaps =
let let
mkTelescopeKeymap = mkTelescopeKeymap =
@ -68,7 +69,7 @@
}: { }: {
inherit key mode; 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; }; options = { inherit desc; };
}; };
in in