From 6c13c0dbc6e22a64040d076d1a952f8982acf6b1 Mon Sep 17 00:00:00 2001 From: Emmanuel Touzery Date: Mon, 3 Oct 2022 08:48:19 +0200 Subject: [PATCH] fix issue when operating from a floating window the floating window would get closed when we open and returning to the original window would crash. --- lua/dressing/select/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/dressing/select/init.lua b/lua/dressing/select/init.lua index 4320b49..0fb427f 100644 --- a/lua/dressing/select/init.lua +++ b/lua/dressing/select/init.lua @@ -65,7 +65,9 @@ return vim.schedule_wrap(function(items, opts, on_choice) items, opts, vim.schedule_wrap(function(...) - vim.api.nvim_win_set_cursor(winid, cursor) + if vim.api.nvim_win_is_valid(winid) then + vim.api.nvim_win_set_cursor(winid, cursor) + end on_choice(...) end) )