summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-19 17:01:28 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-19 17:01:28 +0200
commit00e192becd50a38cb21a1bc3f86fcc7a21f8ee88 (patch)
tree4776eda21d139fc8a4d051db196f43820e33fca0 /src
parentb98678a974914aaf1d00b575364c13a6446353bf (diff)
downloadvim-git-00e192becd50a38cb21a1bc3f86fcc7a21f8ee88.tar.gz
patch 8.1.2180: Error E303 is not useful when 'directory' is emptyv8.1.2180
Problem: Error E303 is not useful when 'directory' is empty. Solution: Skip the error message. (Daniel Hahler, #5067)
Diffstat (limited to 'src')
-rw-r--r--src/memline.c4
-rw-r--r--src/testdir/test_recover.vim6
-rw-r--r--src/version.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/src/memline.c b/src/memline.c
index c77d1df9e..a26e4016a 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -804,9 +804,9 @@ ml_open_file(buf_T *buf)
}
}
- if (mfp->mf_fname == NULL) /* Failed! */
+ if (*p_dir != NUL && mfp->mf_fname == NULL)
{
- need_wait_return = TRUE; /* call wait_return later */
+ need_wait_return = TRUE; // call wait_return later
++no_wait_return;
(void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
diff --git a/src/testdir/test_recover.vim b/src/testdir/test_recover.vim
index a9934a162..a1c7bc4b0 100644
--- a/src/testdir/test_recover.vim
+++ b/src/testdir/test_recover.vim
@@ -12,6 +12,12 @@ func Test_recover_root_dir()
set dir=/notexist/
endif
call assert_fails('split Xtest', 'E303:')
+
+ " No error with empty 'directory' setting.
+ set directory=
+ split XtestOK
+ close!
+
set dir&
endfunc
diff --git a/src/version.c b/src/version.c
index 38f82778b..aebadab03 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2180,
+/**/
2179,
/**/
2178,