From 5bd30d939711f91f1b1ce193656e20d19c759ecd Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 2 Jul 2025 20:36:14 -0400 Subject: [PATCH] don't error when the ui is closed --- lua/dep/ui/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/dep/ui/init.lua b/lua/dep/ui/init.lua index ca27ddd..12f9668 100644 --- a/lua/dep/ui/init.lua +++ b/lua/dep/ui/init.lua @@ -44,7 +44,9 @@ local function page_log() -- put the cursor at the bottom of the page after drawing p.post_draw = function() - vim.api.nvim_win_set_cursor(ui.winnr, { #p.content, 0 }) + if ui.winnr then + vim.api.nvim_win_set_cursor(ui.winnr, { #p.content, 0 }) + end end -- read in the contents of the file, and keep watching for updates