jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.108

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