mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 11:25:33 +00:00
Merge #10034 from frangio/vim-8.1.1352
This commit is contained in:
@@ -10830,6 +10830,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
"mac",
|
"mac",
|
||||||
"macunix",
|
"macunix",
|
||||||
|
"osx",
|
||||||
#endif
|
#endif
|
||||||
"menu",
|
"menu",
|
||||||
"mksession",
|
"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.
|
// If there is no file name there will be no undo file.
|
||||||
rettv->vval.v_string = NULL;
|
rettv->vval.v_string = NULL;
|
||||||
} else {
|
} else {
|
||||||
char *ffname = FullName_save(fname, false);
|
char *ffname = FullName_save(fname, true);
|
||||||
|
|
||||||
if (ffname != NULL) {
|
if (ffname != NULL) {
|
||||||
rettv->vval.v_string = (char_u *)u_get_undo_file_name(ffname, false);
|
rettv->vval.v_string = (char_u *)u_get_undo_file_name(ffname, false);
|
||||||
|
|||||||
@@ -389,6 +389,15 @@ funct Test_undofile()
|
|||||||
" Test undofile() with 'undodir' set to a non-existing directory.
|
" Test undofile() with 'undodir' set to a non-existing directory.
|
||||||
" call assert_equal('', undofile('Xundofoo'))
|
" 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&
|
set undodir&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user