From db46d40d45a9a082cfe5943d8c5913231c855dd0 Mon Sep 17 00:00:00 2001 From: olimorris Date: Fri, 13 May 2022 09:39:28 +0100 Subject: [PATCH] fix(telescope): #7 telescope layout with functions Props to @ranebrown for the solution. This error occured when a user has specified a function for the width value in their telescope layout_config --- lua/telescope/_extensions/persisted.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/telescope/_extensions/persisted.lua b/lua/telescope/_extensions/persisted.lua index 0e57767..9bd5354 100644 --- a/lua/telescope/_extensions/persisted.lua +++ b/lua/telescope/_extensions/persisted.lua @@ -18,6 +18,10 @@ local function search_sessions(opts) or conf.layout_config[conf.layout_strategy].width or cols + if type(telescope_width) == "function" then + telescope_width = telescope_width(_, cols, _) + end + if telescope_width < 1 then telescope_width = math.floor(cols * telescope_width) end