1
0
forked from aniani/vim

updated for version 7.4.108

Problem:    "zG" and "zW" leave temp files around on MS-Windows.
Solution:   Delete the temp files when exiting. (Ken Takata)
This commit is contained in:
Bram Moolenaar 2013-11-28 17:41:46 +01:00
parent 9fee7d4729
commit 34b466edfe
4 changed files with 33 additions and 18 deletions

View File

@ -841,6 +841,9 @@ ml_close_all(del_file)
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 */
#endif

View File

@ -3,6 +3,7 @@ int spell_check __ARGS((win_T *wp, char_u *ptr, hlf_T *attrp, int *capcol, int d
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));

View File

@ -4701,6 +4701,24 @@ badword_captype(word, end)
return flags;
}
/*
* 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.
@ -4710,7 +4728,6 @@ spell_free_all()
{
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)
@ -4723,15 +4740,7 @@ spell_free_all()
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;

View File

@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
108,
/**/
107,
/**/