Open Kyren223 opened 4 weeks ago
Oil uses :help previewwindow
for the preview window, so you can do this yourself pretty easily. Here's how oil gets the preview window internally
You can use this directly if you want, but there's no API contract so the method may be removed or renamed in the future. You could copy the logic to your own config as well, since it's pretty short and simple.
To close the preview window, just do vim.cmd.pclose()
Ah thanks, I'll just copy over that code snippet and use that.
Did you check existing requests?
Describe the feature
Add 2 new API functions (names r just an example) is_preview_open() - returns a boolean close_preview() - closes the preview (might already exist?)
Provide background
If I have preview on and then open a split (with C-s for example) the preview stays open, so I'd like to write a little function that when I press it checks if there is a preview, if there is, closes it, and then opens the new split
What is the significance of this feature?
nice to have
Additional details
Would also love to see #339 gets implemented as I'd need it as well for what I intend to do (although there are workarounds for doing it)