stevearc / dressing.nvim

Neovim plugin to improve the default vim.ui interfaces
MIT License
1.7k stars 32 forks source link

fix issue when operating from a floating window #69

Closed emmanueltouzery closed 1 year ago

emmanueltouzery commented 1 year ago

the floating window would get closed when we open and returning to the original window would crash.

Context

What is the problem you are trying to solve?

Very concretely, I enabled the floating window mode of nvim-tree. When doing that, triggering a file deletion from nvim-tree will call vim.ui.select, which will trigger dressing. Dressing opens a window to confirm the deletion, closing the nvim-tree floating window. When confirming the deletion, dressing attempts to return focus to nvim-tree, but that fails since nvim-tree was closed.

Description

When returning focus to the original window, check whether that one still exists

Test Plan

See context.

emmanueltouzery commented 1 year ago

stylua failed, but it appears to be misconfigured in the CI, the failure is unrelated to the PR.

stevearc commented 1 year ago

Yeah, the newer versions of stylua are broken on CI. I need to pin it.

Thanks for the PR!