lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
a72b725
To: vim_dev@googlegroups.com
a72b725
Subject: Patch 7.4.345
a72b725
Fcc: outbox
a72b725
From: Bram Moolenaar <Bram@moolenaar.net>
a72b725
Mime-Version: 1.0
a72b725
Content-Type: text/plain; charset=UTF-8
a72b725
Content-Transfer-Encoding: 8bit
a72b725
------------
a72b725
a72b725
Patch 7.4.345 (after 7.4.338)
a72b725
Problem:    Indent is not updated when deleting indent.
a72b725
Solution:   Remember changedtick.
a72b725
Files:	    src/misc1.c
a72b725
a72b725
a72b725
*** ../vim-7.4.344/src/misc1.c	2014-06-25 14:39:35.106348584 +0200
a72b725
--- src/misc1.c	2014-06-25 22:51:32.955465286 +0200
a72b725
***************
a72b725
*** 497,502 ****
a72b725
--- 497,503 ----
a72b725
      static int	    prev_indent = 0;  /* cached indent value */
a72b725
      static long	    prev_ts     = 0L; /* cached tabstop value */
a72b725
      static char_u   *prev_line = NULL; /* cached pointer to line */
a72b725
+     static int	    prev_tick = 0;   /* changedtick of cached value */
a72b725
      int		    bri = 0;
a72b725
      /* window width minus window margin space, i.e. what rests for text */
a72b725
      const int	    eff_wwidth = W_WIDTH(wp)
a72b725
***************
a72b725
*** 505,514 ****
a72b725
  						? number_width(wp) + 1 : 0);
a72b725
  
a72b725
      /* used cached indent, unless pointer or 'tabstop' changed */
a72b725
!     if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts)
a72b725
      {
a72b725
  	prev_line = line;
a72b725
  	prev_ts = wp->w_buffer->b_p_ts;
a72b725
  	prev_indent = get_indent_str(line,
a72b725
  		  (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
a72b725
      }
a72b725
--- 506,517 ----
a72b725
  						? number_width(wp) + 1 : 0);
a72b725
  
a72b725
      /* used cached indent, unless pointer or 'tabstop' changed */
a72b725
!     if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts
a72b725
! 				  || prev_tick != wp->w_buffer->b_changedtick)
a72b725
      {
a72b725
  	prev_line = line;
a72b725
  	prev_ts = wp->w_buffer->b_p_ts;
a72b725
+ 	prev_tick = wp->w_buffer->b_changedtick;
a72b725
  	prev_indent = get_indent_str(line,
a72b725
  		  (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
a72b725
      }
a72b725
*** ../vim-7.4.344/src/version.c	2014-06-25 18:15:18.446838249 +0200
a72b725
--- src/version.c	2014-06-25 22:52:55.971468427 +0200
a72b725
***************
a72b725
*** 736,737 ****
a72b725
--- 736,739 ----
a72b725
  {   /* Add new patch number below this line */
a72b725
+ /**/
a72b725
+     345,
a72b725
  /**/
a72b725
a72b725
-- 
a72b725
ARTHUR:  Well, I can't just call you `Man'.
a72b725
DENNIS:  Well, you could say `Dennis'.
a72b725
ARTHUR:  Well, I didn't know you were called `Dennis.'
a72b725
DENNIS:  Well, you didn't bother to find out, did you?
a72b725
                                  The Quest for the Holy Grail (Monty Python)
a72b725
a72b725
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
a72b725
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
a72b725
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
a72b725
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///