From 66613ace48141d71ab12de56d0b0db79f48697d9 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 12 Jun 2019 22:57:04 +0200 Subject: vim-patch:8.0.1704: 'backupskip' default doesn't work for Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/nvim/option.c | 4 ++++ src/nvim/testdir/test_options.vim | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'src') 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 -- cgit