for (buf = firstbuf; buf != NULL; buf = buf->b_next)
ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
|| vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
+#ifdef FEAT_SPELL
+ spell_delete_wordlist(); /* delete the internal wordlist */
+#endif
#ifdef TEMPDIRNAMES
- vim_deltempdir(); /* delete created temp directory */
+ vim_deltempdir(); /* delete created temp directory */
#endif
}
int spell_move_to __ARGS((win_T *wp, int dir, int allwords, int curline, hlf_T *attrp));
void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
char_u *did_set_spelllang __ARGS((win_T *wp));
+void spell_delete_wordlist __ARGS((void));
void spell_free_all __ARGS((void));
void spell_reload __ARGS((void));
int spell_check_msm __ARGS((void));
char_u *endp;
hlf_T attr;
int len;
-# ifdef FEAT_SYN_HL
+#ifdef FEAT_SYN_HL
int has_syntax = syntax_present(wp);
-# endif
+#endif
int col;
int can_spell;
char_u *buf = NULL;
: p - buf)
> wp->w_cursor.col)))
{
-# ifdef FEAT_SYN_HL
+#ifdef FEAT_SYN_HL
if (has_syntax)
{
col = (int)(p - buf);
return flags;
}
-# if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
+/*
+ * Delete the internal wordlist and its .spl file.
+ */
+ void
+spell_delete_wordlist()
+{
+ char_u fname[MAXPATHL];
+
+ if (int_wordlist != NULL)
+ {
+ mch_remove(int_wordlist);
+ int_wordlist_spl(fname);
+ mch_remove(fname);
+ vim_free(int_wordlist);
+ int_wordlist = NULL;
+ }
+}
+
+#if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
/*
* Free all languages.
*/
{
slang_T *slang;
buf_T *buf;
- char_u fname[MAXPATHL];
/* Go through all buffers and handle 'spelllang'. <VN> */
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
slang_free(slang);
}
- if (int_wordlist != NULL)
- {
- /* Delete the internal wordlist and its .spl file */
- mch_remove(int_wordlist);
- int_wordlist_spl(fname);
- mch_remove(fname);
- vim_free(int_wordlist);
- int_wordlist = NULL;
- }
+ spell_delete_wordlist();
vim_free(repl_to);
repl_to = NULL;
vim_free(repl_from);
repl_from = NULL;
}
-# endif
+#endif
-# if defined(FEAT_MBYTE) || defined(PROTO)
+#if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Clear all spelling tables and reload them.
* Used after 'encoding' is set and when ":mkspell" was used.
}
}
}
-# endif
+#endif
/*
* Reload the spell file "fname" if it's loaded.