diff options
author | Jurica Bradarić <jbradaric@users.noreply.github.com> | 2019-10-06 05:35:48 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-10-05 20:35:48 -0700 |
commit | fe074611cd5b3319a3f639f68289df6a718e64eb (patch) | |
tree | f6709dc199d929ddeb75e98b74e74a894b4b5c6c /src/nvim/ex_docmd.c | |
parent | 1396cc9abb0dfcdbd9572706235aba59f7c3318a (diff) | |
download | rneovim-fe074611cd5b3319a3f639f68289df6a718e64eb.tar.gz rneovim-fe074611cd5b3319a3f639f68289df6a718e64eb.tar.bz2 rneovim-fe074611cd5b3319a3f639f68289df6a718e64eb.zip |
vim-patch:8.1.1371: cannot recover from a swap file #11081
Problem: Cannot recover from a swap file.
Solution: Do not expand environment variables in the swap file name.
Do not check the extension when we already know a file is a swap
file. (Ken Takata, closes 4415, closes vim/vim#4369)
https://github.com/vim/vim/commit/99499b1c05f85f83876b828eea3f6e14f0f407b4
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 34b4c10d3e..a6042b0e8c 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6708,17 +6708,18 @@ static void ex_preserve(exarg_T *eap) /// ":recover". static void ex_recover(exarg_T *eap) { - /* Set recoverymode right away to avoid the ATTENTION prompt. */ - recoverymode = TRUE; + // Set recoverymode right away to avoid the ATTENTION prompt. + recoverymode = true; if (!check_changed(curbuf, (p_awa ? CCGD_AW : 0) | CCGD_MULTWIN | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD) && (*eap->arg == NUL - || setfname(curbuf, eap->arg, NULL, TRUE) == OK)) - ml_recover(); - recoverymode = FALSE; + || setfname(curbuf, eap->arg, NULL, true) == OK)) { + ml_recover(true); + } + recoverymode = false; } /* |