mcchrish / nnn.vim

File manager for vim/neovim powered by n³
BSD 2-Clause "Simplified" License
645 stars 24 forks source link

toggle explorer instead of opening a new one #138

Closed N-R-K closed 2 years ago

N-R-K commented 2 years ago

This makes it so running :NnnExplorer while an explorer window is already open toggle/close it instead of opening a new explorer window.

Undocumented, also might need more testing (on both vim and neovim) before merge.

jarun commented 2 years ago

Thank you!

N-R-K commented 2 years ago

@jarun uhhh, the PR wasn't ready for merge yet :sweat_smile: . Wanted some more testing in case there's some weird quirk that happens on vim but not nvim and vice versa.

Welp, shouldn't be a big deal. If there's some quirk/problem, we can fix it on the go.

jarun commented 2 years ago

Use the label work in progress for this purpose.

N-R-K commented 2 years ago

Don't think I can add labels, which is why I put [WIP] on the PR title.

jarun commented 2 years ago

@mcchrish can you please add @N-R-K to the project?

mcchrish commented 2 years ago

Don't think I can add labels, which is why I put [WIP] on the PR title.

I believe you should be able to create a draft PR?

N-R-K commented 2 years ago

I believe you should be able to create a draft PR?

I'll try that next time. Anyways, since it's already merged don't think the label is needed. And it works fine for all "basic" usecases from what I've tested (both vim and nvim), so this should be fine.

jarun commented 2 years ago

@mcchrish in any case, please add @N-R-K to the project.

@N-R-K please confirm when you are added.

N-R-K commented 2 years ago

Thanks, I'm in.

mcchrish commented 2 years ago

@jarun @N-R-K you have merge privileges but let's make sure the one who merged tested the changes and confirms it's working as expected.

luukvbaal commented 2 years ago

Closing the explorer pane by means other than running NnnExplorer will require you to run NnnExplorer twice to open it again with the way you implemented this I think(haven't tested). Which is why I actively check if the window is open in nnn.nvim.

Alternatively I suppose you could clear the tabpage var in the termopen() on_exit callback which might be cleaner now that I think of it.

N-R-K commented 2 years ago

@luukvbaal Yes, moving that in on_exit should fix the problem. I'll wait to see if there's any more problems before creating a new PR.