From 4ac30e0104904bf970ce442d8c33d77d6bd89190 Mon Sep 17 00:00:00 2001 From: Iron-E Date: Mon, 20 Feb 2023 15:10:04 -0500 Subject: [PATCH] fix(Popup): width wrong when first opening --- lua/libmodal/src/utils/Popup.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/libmodal/src/utils/Popup.lua b/lua/libmodal/src/utils/Popup.lua index baf81cc..8c42fc0 100644 --- a/lua/libmodal/src/utils/Popup.lua +++ b/lua/libmodal/src/utils/Popup.lua @@ -46,7 +46,7 @@ function Popup:open(config) relative = 'editor', row = vim.go.lines - vim.go.cmdheight - 1, style = 'minimal', - width = 1 + width = 1, } end @@ -55,6 +55,9 @@ function Popup:open(config) end self.window = vim.api.nvim_open_win(self.buffer, false, config) + + -- HACK: the window always pops up with the wrong width, but this makes it work :shrug: + vim.api.nvim_win_set_width(self.window, config.width) end --- display `input_bytes` in `self.buffer`