zefei / vim-wintabs

Modern buffer manager for Vim
MIT License
325 stars 25 forks source link

Can't undo after changing tab #3

Closed shuLhan closed 9 years ago

shuLhan commented 9 years ago

Lets say I have two tab, A and B.

If I save buffer in tab A, and change to tab B, and switch back to tab A, I can't undo what I has edit before in tab A.

Vim will say "Already at oldest change".

zefei commented 9 years ago

Have you :set undofile or :set hidden?

shuLhan commented 9 years ago

Ok, :set hidden fix it, thank you.

noscript commented 8 years ago

Somehow I cannot get rid of the issue without patching wintabs, even with :set hidden. What am I doing wrong?

Dirty workaround:

--- a/autoload/wintabs.vim
+++ b/autoload/wintabs.vim
@@ -382,7 +382,7 @@ function! s:switch_tab(n, confirm)

   " set nohidden to trigger confirm behavior
   let hidden = &hidden
-  let &hidden = 0
+  "let &hidden = 0

   if a:n < 0
     execute a:confirm ? 'silent! confirm enew' : 'enew!'
noscript commented 8 years ago

Ok, apparently I needed both :set undofile and :set hidden to make it work.