Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Bram Moolenaar <Bram <at> moolenaar.net>
Subject: Patch 7.4.345
Newsgroups: gmane.editors.vim.devel
Date: Wednesday 25th June 2014 20:56:01 UTC (over 3 years ago)
Patch 7.4.345 (after 7.4.338)
Problem:    Indent is not updated when deleting indent.
Solution:   Remember changedtick.
Files:	    src/misc1.c


*** ../vim-7.4.344/src/misc1.c	2014-06-25 14:39:35.106348584 +0200
--- src/misc1.c	2014-06-25 22:51:32.955465286 +0200
***************
*** 497,502 ****
--- 497,503 ----
      static int	    prev_indent = 0;  /* cached indent value */
      static long	    prev_ts     = 0L; /* cached tabstop value */
      static char_u   *prev_line = NULL; /* cached pointer to line */
+     static int	    prev_tick = 0;   /* changedtick of cached value */
      int		    bri = 0;
      /* window width minus window margin space, i.e. what rests for text
*/
      const int	    eff_wwidth = W_WIDTH(wp)
***************
*** 505,514 ****
  						? number_width(wp) + 1 : 0);
  
      /* used cached indent, unless pointer or 'tabstop' changed */
!     if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts)
      {
  	prev_line = line;
  	prev_ts = wp->w_buffer->b_p_ts;
  	prev_indent = get_indent_str(line,
  		  (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
      }
--- 506,517 ----
  						? number_width(wp) + 1 : 0);
  
      /* used cached indent, unless pointer or 'tabstop' changed */
!     if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts
! 				  || prev_tick != wp->w_buffer->b_changedtick)
      {
  	prev_line = line;
  	prev_ts = wp->w_buffer->b_p_ts;
+ 	prev_tick = wp->w_buffer->b_changedtick;
  	prev_indent = get_indent_str(line,
  		  (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
      }
*** ../vim-7.4.344/src/version.c	2014-06-25 18:15:18.446838249 +0200
--- src/version.c	2014-06-25 22:52:55.971468427 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     345,
  /**/

-- 
ARTHUR:  Well, I can't just call you `Man'.
DENNIS:  Well, you could say `Dennis'.
ARTHUR:  Well, I didn't know you were called `Dennis.'
DENNIS:  Well, you didn't bother to find out, did you?
                                  The Quest for the Holy Grail (Monty
Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
  \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org       
///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org  
 ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected]
For more options, visit https://groups.google.com/d/optout.
 
CD: 2ms