lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
611d6f2
To: vim_dev@googlegroups.com
611d6f2
Subject: Patch 7.4.108
611d6f2
Fcc: outbox
611d6f2
From: Bram Moolenaar <Bram@moolenaar.net>
611d6f2
Mime-Version: 1.0
611d6f2
Content-Type: text/plain; charset=UTF-8
611d6f2
Content-Transfer-Encoding: 8bit
611d6f2
------------
611d6f2
611d6f2
Patch 7.4.108
611d6f2
Problem:    "zG" and "zW" leave temp files around on MS-Windows.
611d6f2
Solution:   Delete the temp files when exiting. (Ken Takata)
611d6f2
Files:	    src/memline.c, src/proto/spell.pro, src/spell.c
611d6f2
611d6f2
611d6f2
*** ../vim-7.4.107/src/memline.c	2013-11-04 02:53:46.000000000 +0100
611d6f2
--- src/memline.c	2013-11-28 17:27:06.000000000 +0100
611d6f2
***************
611d6f2
*** 841,848 ****
611d6f2
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
611d6f2
  	ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
611d6f2
  				 || vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
611d6f2
  #ifdef TEMPDIRNAMES
611d6f2
!     vim_deltempdir();	    /* delete created temp directory */
611d6f2
  #endif
611d6f2
  }
611d6f2
  
611d6f2
--- 841,851 ----
611d6f2
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
611d6f2
  	ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
611d6f2
  				 || vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
611d6f2
+ #ifdef FEAT_SPELL
611d6f2
+     spell_delete_wordlist();	/* delete the internal wordlist */
611d6f2
+ #endif
611d6f2
  #ifdef TEMPDIRNAMES
611d6f2
!     vim_deltempdir();		/* delete created temp directory */
611d6f2
  #endif
611d6f2
  }
611d6f2
  
611d6f2
*** ../vim-7.4.107/src/proto/spell.pro	2013-08-10 13:37:26.000000000 +0200
611d6f2
--- src/proto/spell.pro	2013-11-28 17:25:59.000000000 +0100
611d6f2
***************
611d6f2
*** 3,8 ****
611d6f2
--- 3,9 ----
611d6f2
  int spell_move_to __ARGS((win_T *wp, int dir, int allwords, int curline, hlf_T *attrp));
611d6f2
  void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
611d6f2
  char_u *did_set_spelllang __ARGS((win_T *wp));
611d6f2
+ void spell_delete_wordlist __ARGS((void));
611d6f2
  void spell_free_all __ARGS((void));
611d6f2
  void spell_reload __ARGS((void));
611d6f2
  int spell_check_msm __ARGS((void));
611d6f2
*** ../vim-7.4.107/src/spell.c	2013-11-21 17:42:26.000000000 +0100
611d6f2
--- src/spell.c	2013-11-28 17:25:59.000000000 +0100
611d6f2
***************
611d6f2
*** 2180,2188 ****
611d6f2
      char_u	*endp;
611d6f2
      hlf_T	attr;
611d6f2
      int		len;
611d6f2
! # ifdef FEAT_SYN_HL
611d6f2
      int		has_syntax = syntax_present(wp);
611d6f2
! # endif
611d6f2
      int		col;
611d6f2
      int		can_spell;
611d6f2
      char_u	*buf = NULL;
611d6f2
--- 2180,2188 ----
611d6f2
      char_u	*endp;
611d6f2
      hlf_T	attr;
611d6f2
      int		len;
611d6f2
! #ifdef FEAT_SYN_HL
611d6f2
      int		has_syntax = syntax_present(wp);
611d6f2
! #endif
611d6f2
      int		col;
611d6f2
      int		can_spell;
611d6f2
      char_u	*buf = NULL;
611d6f2
***************
611d6f2
*** 2280,2286 ****
611d6f2
  						     : p - buf)
611d6f2
  						  > wp->w_cursor.col)))
611d6f2
  		    {
611d6f2
! # ifdef FEAT_SYN_HL
611d6f2
  			if (has_syntax)
611d6f2
  			{
611d6f2
  			    col = (int)(p - buf);
611d6f2
--- 2280,2286 ----
611d6f2
  						     : p - buf)
611d6f2
  						  > wp->w_cursor.col)))
611d6f2
  		    {
611d6f2
! #ifdef FEAT_SYN_HL
611d6f2
  			if (has_syntax)
611d6f2
  			{
611d6f2
  			    col = (int)(p - buf);
611d6f2
***************
611d6f2
*** 4701,4707 ****
611d6f2
      return flags;
611d6f2
  }
611d6f2
  
611d6f2
! # if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
611d6f2
  /*
611d6f2
   * Free all languages.
611d6f2
   */
611d6f2
--- 4701,4725 ----
611d6f2
      return flags;
611d6f2
  }
611d6f2
  
611d6f2
! /*
611d6f2
!  * Delete the internal wordlist and its .spl file.
611d6f2
!  */
611d6f2
!     void
611d6f2
! spell_delete_wordlist()
611d6f2
! {
611d6f2
!     char_u	fname[MAXPATHL];
611d6f2
! 
611d6f2
!     if (int_wordlist != NULL)
611d6f2
!     {
611d6f2
! 	mch_remove(int_wordlist);
611d6f2
! 	int_wordlist_spl(fname);
611d6f2
! 	mch_remove(fname);
611d6f2
! 	vim_free(int_wordlist);
611d6f2
! 	int_wordlist = NULL;
611d6f2
!     }
611d6f2
! }
611d6f2
! 
611d6f2
! #if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
611d6f2
  /*
611d6f2
   * Free all languages.
611d6f2
   */
611d6f2
***************
611d6f2
*** 4710,4716 ****
611d6f2
  {
611d6f2
      slang_T	*slang;
611d6f2
      buf_T	*buf;
611d6f2
-     char_u	fname[MAXPATHL];
611d6f2
  
611d6f2
      /* Go through all buffers and handle 'spelllang'. <VN> */
611d6f2
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
611d6f2
--- 4728,4733 ----
611d6f2
***************
611d6f2
*** 4723,4746 ****
611d6f2
  	slang_free(slang);
611d6f2
      }
611d6f2
  
611d6f2
!     if (int_wordlist != NULL)
611d6f2
!     {
611d6f2
! 	/* Delete the internal wordlist and its .spl file */
611d6f2
! 	mch_remove(int_wordlist);
611d6f2
! 	int_wordlist_spl(fname);
611d6f2
! 	mch_remove(fname);
611d6f2
! 	vim_free(int_wordlist);
611d6f2
! 	int_wordlist = NULL;
611d6f2
!     }
611d6f2
  
611d6f2
      vim_free(repl_to);
611d6f2
      repl_to = NULL;
611d6f2
      vim_free(repl_from);
611d6f2
      repl_from = NULL;
611d6f2
  }
611d6f2
! # endif
611d6f2
  
611d6f2
! # if defined(FEAT_MBYTE) || defined(PROTO)
611d6f2
  /*
611d6f2
   * Clear all spelling tables and reload them.
611d6f2
   * Used after 'encoding' is set and when ":mkspell" was used.
611d6f2
--- 4740,4755 ----
611d6f2
  	slang_free(slang);
611d6f2
      }
611d6f2
  
611d6f2
!     spell_delete_wordlist();
611d6f2
  
611d6f2
      vim_free(repl_to);
611d6f2
      repl_to = NULL;
611d6f2
      vim_free(repl_from);
611d6f2
      repl_from = NULL;
611d6f2
  }
611d6f2
! #endif
611d6f2
  
611d6f2
! #if defined(FEAT_MBYTE) || defined(PROTO)
611d6f2
  /*
611d6f2
   * Clear all spelling tables and reload them.
611d6f2
   * Used after 'encoding' is set and when ":mkspell" was used.
611d6f2
***************
611d6f2
*** 4773,4779 ****
611d6f2
  	}
611d6f2
      }
611d6f2
  }
611d6f2
! # endif
611d6f2
  
611d6f2
  /*
611d6f2
   * Reload the spell file "fname" if it's loaded.
611d6f2
--- 4782,4788 ----
611d6f2
  	}
611d6f2
      }
611d6f2
  }
611d6f2
! #endif
611d6f2
  
611d6f2
  /*
611d6f2
   * Reload the spell file "fname" if it's loaded.
611d6f2
*** ../vim-7.4.107/src/version.c	2013-11-28 17:04:38.000000000 +0100
611d6f2
--- src/version.c	2013-11-28 17:26:31.000000000 +0100
611d6f2
***************
611d6f2
*** 740,741 ****
611d6f2
--- 740,743 ----
611d6f2
  {   /* Add new patch number below this line */
611d6f2
+ /**/
611d6f2
+     108,
611d6f2
  /**/
611d6f2
611d6f2
-- 
611d6f2
hundred-and-one symptoms of being an internet addict:
611d6f2
9. All your daydreaming is preoccupied with getting a faster connection to the
611d6f2
   net: 28.8...ISDN...cable modem...T1...T3.
611d6f2
611d6f2
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
611d6f2
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
611d6f2
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
611d6f2
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///