undoquit.vim icon indicating copy to clipboard operation
undoquit.vim copied to clipboard

Tab closed via `tabc n` cannot be undo.

Open sihunqu123 opened this issue 5 years ago • 2 comments

When close a tab with tab n, where n is the tab number to be close, then <c-w>c won't works.

sihunqu123 avatar May 09 '20 14:05 sihunqu123

The plugin can only work with :quit and ZZ, and potentially any other keybindings that close a window while triggering the QuitPre event. Unfortunately, tabclose doesn't do that, so tab information can't be detected and stored. There's more explanations in the discussion in https://github.com/AndrewRadev/undoquit.vim/issues/10.

I've implemented a workaround of sorts -- the plugin now provides an :UndoableTabclose command that should work the same way as the bulit-in :tabclose. You could map it to something and use that instead. I realize it's inconvenient, but there's nothing I can do to support tabclose n, at least as far as I know.

You can see the details of how this works in the updated documentation. Could you try it out and let me know what you think?

AndrewRadev avatar May 14 '20 19:05 AndrewRadev

Got it, thanks.

sihunqu123 avatar Jun 01 '20 01:06 sihunqu123