From 8b3c0b87ffdf88c7f299720c625f50cdf67c8b3a Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Sun, 19 May 2019 15:25:18 -0300 Subject: vim-patch:8.1.1352: undofile() reports wrong name Problem: Undofile() reports wrong name. (Francisco Giordano) Solution: Clean up the name before changing path separators. (closes vim/vim#4392, closes vim/vim#4394) https://github.com/vim/vim/commit/e9ebc9a91cac357fd4888f4b71fdff7d97b41160 --- src/nvim/eval.c | 2 +- src/nvim/testdir/test_undo.vim | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit From 16cac1d5f58afb4bf1e2cceaa2b2e3f9a469eef1 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Sun, 19 May 2019 16:39:26 -0300 Subject: vim-patch:8.1.1353: undo test fails on Mac Problem: Undo test fails on Mac. Solution: Expect "private" on the Mac. https://github.com/vim/vim/commit/2b39d806f04c1a474b6d689a7970253850d4adb8 --- src/nvim/testdir/test_undo.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim index 08facb8344..0cb5dc4033 100644 --- a/src/nvim/testdir/test_undo.vim +++ b/src/nvim/testdir/test_undo.vim @@ -391,7 +391,11 @@ funct Test_undofile() if isdirectory('/tmp') set undodir=/tmp - call assert_equal('/tmp/%tmp%file', undofile('///tmp/file')) + 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& -- cgit From 766cc60337b57c874b09c909444f9978a78ccad1 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Sun, 19 May 2019 16:57:41 -0300 Subject: eval.c: add has("osx") for apple --- src/nvim/eval.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 82dc0116eb..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", -- cgit