aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-05-20 00:19:44 +0200
committerGitHub <noreply@github.com>2019-05-20 00:19:44 +0200
commit8c842b39ba7e88fbe6e2fd562731030d5499e343 (patch)
tree67d05283f04863c79dcd3126a9f60c188e1a0c2c /src
parent5c13f368c650f7a66e562d573d91266d2d8e3264 (diff)
parent766cc60337b57c874b09c909444f9978a78ccad1 (diff)
downloadrneovim-8c842b39ba7e88fbe6e2fd562731030d5499e343.tar.gz
rneovim-8c842b39ba7e88fbe6e2fd562731030d5499e343.tar.bz2
rneovim-8c842b39ba7e88fbe6e2fd562731030d5499e343.zip
Merge #10034 from frangio/vim-8.1.1352
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c3
-rw-r--r--src/nvim/testdir/test_undo.vim9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index bd61925b0d..132450f7a1 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -10830,6 +10830,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
#ifdef __APPLE__
"mac",
"macunix",
+ "osx",
#endif
"menu",
"mksession",
@@ -17669,7 +17670,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..0cb5dc4033 100644
--- a/src/nvim/testdir/test_undo.vim
+++ b/src/nvim/testdir/test_undo.vim
@@ -389,6 +389,15 @@ funct Test_undofile()
" Test undofile() with 'undodir' set to a non-existing directory.
" call assert_equal('', undofile('Xundofoo'))
+ if isdirectory('/tmp')
+ set undodir=/tmp
+ if has('osx')
+ call assert_equal('/tmp/%private%tmp%file', undofile('///tmp/file'))
+ else
+ call assert_equal('/tmp/%tmp%file', undofile('///tmp/file'))
+ endif
+ endif
+
set undodir&
endfunc