From 4f1bcddcd9b5923351b6fcdff346afcb30132b53 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 28 Dec 2024 18:48:37 -0500 Subject: [PATCH] fzf-lua winopts tweaks --- lua/plugins/telescope.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 9fb619d..eee3248 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -199,6 +199,18 @@ local P = { -- Define Telescope Plugins Specs glob_separator = '%s%-%-', -- query separator pattern (lua): ' --' }, }, + init = function() + require('fzf-lua').register_ui_select(function(_, items) + local min_h, max_h = 0.15, 0.70 + local h = (#items + 4) / vim.o.lines + if h < min_h then + h = min_h + elseif h > max_h then + h = max_h + end + return { winopts = { height = h, width = 0.60, row = 0.40 } } + end) + end, }, { 'danielfalk/smart-open.nvim',