aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spell.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-02-06 10:20:49 -0500
committerGitHub <noreply@github.com>2017-02-06 10:20:49 -0500
commit11efbc80e328d6e92bdb1cdcf6aeac98050c2077 (patch)
treeffd45f3dab501339999687416c8a3a1e577d899f /src/nvim/spell.c
parenta767fee8cd0e6874e528d88f5a8dcf70259dabdd (diff)
parentb0cf071d437699b9b89e3735b3df41914f302eb1 (diff)
downloadrneovim-11efbc80e328d6e92bdb1cdcf6aeac98050c2077.tar.gz
rneovim-11efbc80e328d6e92bdb1cdcf6aeac98050c2077.tar.bz2
rneovim-11efbc80e328d6e92bdb1cdcf6aeac98050c2077.zip
Merge pull request #5913 from mhinz/buf-lookup-patches
vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r--src/nvim/spell.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 7e0bbd6ad1..1ace39344d 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -3746,6 +3746,9 @@ char_u *did_set_spelllang(win_T *wp)
char_u *ret_msg = NULL;
char_u *spl_copy;
+ bufref_T bufref;
+ set_bufref(&bufref, wp->w_buffer);
+
// We don't want to do this recursively. May happen when a language is
// not available and the SpellFileMissing autocommand opens a new buffer
// in which 'spell' is set.
@@ -3824,7 +3827,7 @@ char_u *did_set_spelllang(win_T *wp)
spell_load_lang(lang);
// SpellFileMissing autocommands may do anything, including
// destroying the buffer we are using...
- if (!buf_valid(wp->w_buffer)) {
+ if (!bufref_valid(&bufref)) {
ret_msg =
(char_u *)"E797: SpellFileMissing autocommand deleted buffer";
goto theend;
@@ -13037,8 +13040,9 @@ void ex_spelldump(exarg_T *eap)
set_option_value((char_u*)"spl", dummy, spl, OPT_LOCAL);
xfree(spl);
- if (!bufempty() || !buf_valid(curbuf))
+ if (!bufempty()) {
return;
+ }
spell_dump_compl(NULL, 0, NULL, eap->forceit ? DUMPFLAG_COUNT : 0);