Giter Club home page Giter Club logo

Comments (5)

echasnovski avatar echasnovski commented on September 15, 2024 2

When that happens, even if you can close the window with <C-w>o, you can't reopen the file explorer afterwards. It requires to restart neovim and it's a bit of a workflow breaker.

I briefly checked earlier and I could open it up again. After rechecking again, I can definitely reproduce it not opening again, but not on the first try and under some not trivial steps.

I agree, having to account for opened explorer in mappings is not ideal and should not be required. I'll take a look (at least there is 'winfixbuf' option in Neovim>=0.10 which seems to make it work by showing error but explorer is still valid).

It may be better to check if a file explorer is open and if its false do the command, else do nothing than to close it if it's true, but I don't know how to do that as of now (is there a way by checking the MiniFiles events ? or a function ?).

Although shouldn't be needed for this case, I plan to add such function soon because there is a #1162 that could benefit from it.

from mini.nvim.

echasnovski avatar echasnovski commented on September 15, 2024

Thanks for the issue!

I can reproduce. not sure if this is a reasonable use case to account for though: neither deleting a buffer nor switching to another one makes sense inside a file explorer. And all the windows after the error can be closed with <C-w>o (and the fact that they don't close automatically may the real issue here). I'll think about it.

from mini.nvim.

Gael-Lopes-Da-Silva avatar Gael-Lopes-Da-Silva commented on September 15, 2024

Thanks for the issue!

I can reproduce. not sure if this is a reasonable use case to account for though: neither deleting a buffer nor switching to another one makes sense inside a file explorer. And all the windows after the error can be closed with <C-w>o (and the fact that they don't close automatically may the real issue here). I'll think about it.

I'm happy to help.

For me, the problem does not lay in the use case (because like you said, it does not make sens to switch buffer or close buffer in the file explorer) but in the fact that opening the file explorer, switching buffers or closing buffers are common things to do. For example, I hit the switch buffer or close buffer key without closing the file explorer, because I made a mistake or I typed to quickly. When that happens, even if you can close the window with <C-w>o, you can't reopen the file explorer afterwards. It requires to restart neovim and it's a bit of a workflow breaker.

As a workaround, I manually modified the keybindings to add the following in my config files:

if not require("mini.files").close() then
	-- The command
end

I'm pretty sure that it's not the best way to do that. It may be better to check if a file explorer is open and if its false do the command, else do nothing than to close it if it's true, but I don't know how to do that as of now (is there a way by checking the MiniFiles events ? or a function ?).

from mini.nvim.

echasnovski avatar echasnovski commented on September 15, 2024

This should now be resolved on latest main, but only for Neovim>=0.10. Trying to switch buffers will show an error (which is expected because 'mini.files' windows are expected to show only dedicated buffers) but explorer will be fully usable afterwards. The reason it is resolved only on Neovim>=0.10 is because it introduced the 'winfixbuf' option which allows permanently "pair" window and buffer.

from mini.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.