On Mi, 25 Jun 2014, itchyny wrote:

> To reproduce
> vim -u NONE -N
> 500ia<ESC>^
> :set breakindent
> >>
> >>
> >>
> XXX
> 
> Problem
> The second and the following lines are kept indented.
> 
> Expected behaviour
> The indent level follows that of the first line.

Okay, perhaps caching the indent isn't such a smart idea after all.

Mit freundlichen Grüßen
Christian
-- 
Tottis Frau Ilary fragt: "Oh Liebling, liebst du mich, liebst du mich,
liebst du mich denn wirklich?"
Totti: "Gemach, eine Frage nach der anderen."

-- 
-- 
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.
diff --git a/src/misc1.c b/src/misc1.c
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -494,9 +494,6 @@ get_breakindent_win(wp, line)
     win_T	*wp;
     char_u	*line; /* start of the line */
 {
-    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 */
     int		    bri = 0;
     /* window width minus window margin space, i.e. what rests for text */
     const int	    eff_wwidth = W_WIDTH(wp)
@@ -504,17 +501,10 @@ get_breakindent_win(wp, line)
 				&& (vim_strchr(p_cpo, CPO_NUMCOL) == NULL)
 						? 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,
+    bri = get_indent_str(line,
 		  (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
-    }
 
     /* indent minus the length of the showbreak string */
-    bri = prev_indent;
     if (wp->w_p_brisbr)
 	bri -= vim_strsize(p_sbr);
 

Raspunde prin e-mail lui