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/spell.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/spell.c')
-rw-r--r-- | src/nvim/spell.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 724a0332bc..ab40355a8a 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -2031,7 +2031,8 @@ char_u *did_set_spelllang(win_T *wp) // Check if we loaded this language before. for (slang = first_lang; slang != NULL; slang = slang->sl_next) { - if (path_full_compare(lang, slang->sl_fname, false) == kEqualFiles) { + if (path_full_compare(lang, slang->sl_fname, false, true) + == kEqualFiles) { break; } } @@ -2076,7 +2077,7 @@ char_u *did_set_spelllang(win_T *wp) // Loop over the languages, there can be several files for "lang". for (slang = first_lang; slang != NULL; slang = slang->sl_next) { if (filename - ? path_full_compare(lang, slang->sl_fname, false) == kEqualFiles + ? path_full_compare(lang, slang->sl_fname, false, true) == kEqualFiles : STRICMP(lang, slang->sl_name) == 0) { region_mask = REGION_ALL; if (!filename && region != NULL) { @@ -2129,7 +2130,7 @@ char_u *did_set_spelllang(win_T *wp) for (c = 0; c < ga.ga_len; ++c) { p = LANGP_ENTRY(ga, c)->lp_slang->sl_fname; if (p != NULL - && path_full_compare(spf_name, p, false) == kEqualFiles) { + && path_full_compare(spf_name, p, false, true) == kEqualFiles) { break; } } @@ -2139,7 +2140,8 @@ char_u *did_set_spelllang(win_T *wp) // Check if it was loaded already. for (slang = first_lang; slang != NULL; slang = slang->sl_next) { - if (path_full_compare(spf_name, slang->sl_fname, false) == kEqualFiles) { + if (path_full_compare(spf_name, slang->sl_fname, false, true) + == kEqualFiles) { break; } } |