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