Skip to content

Commit 3d67216

Browse files
phanenibhagwan
authored andcommitted
fix(win): when size is string
1 parent 2dce48d commit 3d67216

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lua/fzf-lua/win.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,8 @@ function FzfWin:normalize_winopts()
567567
local ch = winopts.zindex >= 200 and 0 or vim.o.cmdheight
568568
local max_width = vim.o.columns
569569
local max_height = vim.o.lines - ch
570-
winopts.width = self:normalize_size(winopts.width, max_width)
571-
winopts.height = self:normalize_size(winopts.height, max_height)
570+
winopts.width = self:normalize_size(tonumber(winopts.width), max_width)
571+
winopts.height = self:normalize_size(tonumber(winopts.height), max_height)
572572
if winopts.relative == "cursor" then
573573
-- convert cursor relative to absolute ('editor'),
574574
-- this solves the preview positioning seamlessly
@@ -582,8 +582,8 @@ function FzfWin:normalize_winopts()
582582
else
583583
-- make row close to the center of screen (include cmdheight)
584584
-- avoid breaking existing test
585-
winopts.row = self:normalize_size(winopts.row, vim.o.lines - winopts.height)
586-
winopts.col = self:normalize_size(winopts.col, max_width - winopts.width)
585+
winopts.row = self:normalize_size(tonumber(winopts.row), vim.o.lines - winopts.height)
586+
winopts.col = self:normalize_size(tonumber(winopts.col), max_width - winopts.width)
587587
winopts.row = math.min(winopts.row, max_height - winopts.height)
588588
end
589589
-- width/height can be used for text area

0 commit comments

Comments
 (0)