Skip to content

Commit 5f230cb

Browse files
committed
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)
1 parent 6191c14 commit 5f230cb

File tree

4 files changed

+33
-18
lines changed

4 files changed

+33
-18
lines changed

src/memline.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,11 @@ ml_close_all(del_file)
841841
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
842842
ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
843843
|| vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
844+
#ifdef FEAT_SPELL
845+
spell_delete_wordlist(); /* delete the internal wordlist */
846+
#endif
844847
#ifdef TEMPDIRNAMES
845-
vim_deltempdir(); /* delete created temp directory */
848+
vim_deltempdir(); /* delete created temp directory */
846849
#endif
847850
}
848851

src/proto/spell.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ int spell_check __ARGS((win_T *wp, char_u *ptr, hlf_T *attrp, int *capcol, int d
33
int spell_move_to __ARGS((win_T *wp, int dir, int allwords, int curline, hlf_T *attrp));
44
void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
55
char_u *did_set_spelllang __ARGS((win_T *wp));
6+
void spell_delete_wordlist __ARGS((void));
67
void spell_free_all __ARGS((void));
78
void spell_reload __ARGS((void));
89
int spell_check_msm __ARGS((void));

src/spell.c

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,9 +2180,9 @@ spell_move_to(wp, dir, allwords, curline, attrp)
21802180
char_u *endp;
21812181
hlf_T attr;
21822182
int len;
2183-
# ifdef FEAT_SYN_HL
2183+
#ifdef FEAT_SYN_HL
21842184
int has_syntax = syntax_present(wp);
2185-
# endif
2185+
#endif
21862186
int col;
21872187
int can_spell;
21882188
char_u *buf = NULL;
@@ -2280,7 +2280,7 @@ spell_move_to(wp, dir, allwords, curline, attrp)
22802280
: p - buf)
22812281
> wp->w_cursor.col)))
22822282
{
2283-
# ifdef FEAT_SYN_HL
2283+
#ifdef FEAT_SYN_HL
22842284
if (has_syntax)
22852285
{
22862286
col = (int)(p - buf);
@@ -4701,7 +4701,25 @@ badword_captype(word, end)
47014701
return flags;
47024702
}
47034703

4704-
# if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
4704+
/*
4705+
* Delete the internal wordlist and its .spl file.
4706+
*/
4707+
void
4708+
spell_delete_wordlist()
4709+
{
4710+
char_u fname[MAXPATHL];
4711+
4712+
if (int_wordlist != NULL)
4713+
{
4714+
mch_remove(int_wordlist);
4715+
int_wordlist_spl(fname);
4716+
mch_remove(fname);
4717+
vim_free(int_wordlist);
4718+
int_wordlist = NULL;
4719+
}
4720+
}
4721+
4722+
#if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
47054723
/*
47064724
* Free all languages.
47074725
*/
@@ -4710,7 +4728,6 @@ spell_free_all()
47104728
{
47114729
slang_T *slang;
47124730
buf_T *buf;
4713-
char_u fname[MAXPATHL];
47144731

47154732
/* Go through all buffers and handle 'spelllang'. <VN> */
47164733
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
@@ -4723,24 +4740,16 @@ spell_free_all()
47234740
slang_free(slang);
47244741
}
47254742

4726-
if (int_wordlist != NULL)
4727-
{
4728-
/* Delete the internal wordlist and its .spl file */
4729-
mch_remove(int_wordlist);
4730-
int_wordlist_spl(fname);
4731-
mch_remove(fname);
4732-
vim_free(int_wordlist);
4733-
int_wordlist = NULL;
4734-
}
4743+
spell_delete_wordlist();
47354744

47364745
vim_free(repl_to);
47374746
repl_to = NULL;
47384747
vim_free(repl_from);
47394748
repl_from = NULL;
47404749
}
4741-
# endif
4750+
#endif
47424751

4743-
# if defined(FEAT_MBYTE) || defined(PROTO)
4752+
#if defined(FEAT_MBYTE) || defined(PROTO)
47444753
/*
47454754
* Clear all spelling tables and reload them.
47464755
* Used after 'encoding' is set and when ":mkspell" was used.
@@ -4773,7 +4782,7 @@ spell_reload()
47734782
}
47744783
}
47754784
}
4776-
# endif
4785+
#endif
47774786

47784787
/*
47794788
* Reload the spell file "fname" if it's loaded.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
108,
741743
/**/
742744
107,
743745
/**/

0 commit comments

Comments
 (0)