diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_undo.vim | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index bd61925b0d..82dc0116eb 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -17669,7 +17669,7 @@ static void f_undofile(typval_T *argvars, typval_T *rettv, FunPtr fptr) // If there is no file name there will be no undo file. rettv->vval.v_string = NULL; } else { - char *ffname = FullName_save(fname, false); + char *ffname = FullName_save(fname, true); if (ffname != NULL) { rettv->vval.v_string = (char_u *)u_get_undo_file_name(ffname, false); diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim index beb44f9699..08facb8344 100644 --- a/src/nvim/testdir/test_undo.vim +++ b/src/nvim/testdir/test_undo.vim @@ -389,6 +389,11 @@ funct Test_undofile() " Test undofile() with 'undodir' set to a non-existing directory. " call assert_equal('', undofile('Xundofoo')) + if isdirectory('/tmp') + set undodir=/tmp + call assert_equal('/tmp/%tmp%file', undofile('///tmp/file')) + endif + set undodir& endfunc |