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