Seems like a bug. But to work around it you could :wundo before :qall!
Justin M. Keyes
I tried that and it didn't work. First, :wundo needs a filename, so I gave it the name of the current undo file. And then it didn't save the change I made and undid.
- Dave
Why does the second draft still have "earlier 1f" ? Why can't you just write the undo file?
> On Jul 28, 2015 18:31, "David Besen" <[hidden email]> wrote:
> >
> > Second draft, seems to work a little better:
> >
> > "save undo if we qa!
> > function! MyWundoQuit()
> > let undoseq = undotree().seq_cur
> > earlier 1f
> > let undof = escape(undofile(expand('%')),'% ')
> > exec "wundo " . undof
> > silent! exec "u " . undoseq
> > endfunction
> >
> > autocmd BufWinLeave * call MyWundoQuit()
> Why does the second draft still have "earlier 1f" ? Why can't you just write the undo file?