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
main
olimorris 2022-05-13 09:39:28 +01:00
parent 0c392ddb9f
commit db46d40d45
1 changed files with 4 additions and 0 deletions

View File

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