chrisbra/SudoEdit.vim — Issue #5: E828: Cannot open undo file for writing / odd path from undofile()
Author: blueyed
Created: 2011-12-05 10:01:45+00:00
State: open

When trying to SudoWrite a file like /etc/fstab, I am getting the following error:

"/etc/fstab" 26L, 1473C written
Error detected while processing function SudoEdit#SudoDo..SudoEdit#LocalSettings:
line 16:
E828: Cannot open undo file for writing: /home/user/.local/share/vim/undo//etc/fstabetc/etc/fstabfstab

It looks like the undofile() function returns some odd path (in SudoEdit#LocalSettings), but works properly when called manually:

:echo undofile(@%)
/home/user/.local/share/vim/undo/%etc%fstab

Using Vim 7.3.315.

This is related to the fix for issue 3.