diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-12 22:57:04 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-06-13 00:28:16 +0200 |
commit | 66613ace48141d71ab12de56d0b0db79f48697d9 (patch) | |
tree | 347162dea46b5fce93125751d57c3fc9305c96f1 /src | |
parent | 5db3be092af2853c4f45f4933494bb62249ac994 (diff) | |
download | rneovim-66613ace48141d71ab12de56d0b0db79f48697d9.tar.gz rneovim-66613ace48141d71ab12de56d0b0db79f48697d9.tar.bz2 rneovim-66613ace48141d71ab12de56d0b0db79f48697d9.zip |
vim-patch:8.0.1704: 'backupskip' default doesn't work for Mac
Problem: 'backupskip' default doesn't work for Mac.
Solution: Use "/private/tmp". (Rainer Müller, closes vim/vim#2793)
https://github.com/vim/vim/commit/b8e22a053b68774dfd86fd829d9dba2333f09c05
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index fde1116cc9..a39be0fe96 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -626,7 +626,11 @@ void set_init_1(void) char *p; # ifdef UNIX if (*names[n] == NUL) { +# ifdef __APPLE__ + p = "/private/tmp"; +# else p = "/tmp"; +# endif mustfree = false; } else # endif diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index d867964562..25d9a426f7 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -345,6 +345,22 @@ func Test_set_indentexpr() bwipe! endfunc +func Test_backupskip() + if has("mac") + call assert_match('/private/tmp/\*', &bsk) + elseif has("unix") + call assert_match('/tmp/\*', &bsk) + endif + + let bskvalue = substitute(&bsk, '\\', '/', 'g') + for var in ['$TEMPDIR', '$TMP', '$TEMP'] + if exists(var) + let varvalue = substitute(expand(var), '\\', '/', 'g') + call assert_match(varvalue . '.\*', bskvalue) + endif + endfor +endfunc + func Test_copy_winopt() set hidden |