On Mo, 17 Nov 2014, Nazri Ramliy wrote:

> Steps to reproduce (in a 120 columns by 84 rows terminal):
> 
> $ echo $COLUMNS $LINES
> 74 120
> $ {
> for i in `seq 1 8`; do printf 'lorem ipsum '; done
> echo
> for i in `seq 1 4`; do
>      for i in `seq 1 60`; do printf ' '; done
>      for i in `seq 1 8`; do printf 'lorem ipsum '; done
>      echo
> done
> for i in `seq 1 2`; do
>      printf '   lorem ipsum'
>      echo
> done
> } | vi -u NONE -c 'set rnu linebreak' -
> 
> Now visual-block select the last two lines and start insert mode as if
> you want to insert common text at the beginning of the two lines:
> 
> Gk<c-v>j
> 
> Note the relative line numbers, and hit "I"
> 
> Bug 1: Notice that the relative numbers above the current cursor is no
> longer correct.

Attached patch should fix it.

> 
> Bug 2: Now type one character in that insert mode and notice that the
> lines above the cursor is redrawn as if "set nolinebreak" was set. As
> soon as you hit escape the lines above the cursor is redrawn again
> with the proper effect of "set linebreak".

Patch from 
https://groups.google.com/d/msg/vim_dev/kv5kg0fZxRQ/1grx0E-XlIUJ
should fix this one.

Best,
Christian
-- 
Wie man aus Gewohnheit nach einer abgelaufenen Uhr hinsieht, als 
wenn sie noch ginge, so blickt man auch wohl einer Schönen ins 
Gesicht, als wenn sie noch liebte.
                -- Goethe, Maximen und Reflektionen, Nr. 383

-- 
-- 
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
@@ -3190,8 +3190,7 @@ changed_common(lnum, col, lnume, xtra)
 		set_topline(wp, wp->w_topline);
 #endif
 	    /* relative numbering may require updating more */
-	    if (wp->w_p_rnu)
-		redraw_win_later(wp, SOME_VALID);
+	    redraw_relnumber_win(wp);
 	}
     }
 
diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -1597,6 +1597,7 @@ do_pending_operator(cap, old_col, gui_ya
 #endif
 	    oap->end = curwin->w_cursor;
 	    curwin->w_cursor = oap->start;
+	    redraw_relnumber_win(curwin);
 
 	    /* w_virtcol may have been updated; if the cursor goes back to its
 	     * previous position w_virtcol becomes invalid and isn't updated
diff --git a/src/proto/screen.pro b/src/proto/screen.pro
--- a/src/proto/screen.pro
+++ b/src/proto/screen.pro
@@ -1,4 +1,5 @@
 /* screen.c */
+void redraw_relnumber_win __ARGS((win_T *wp));
 void redraw_later __ARGS((int type));
 void redraw_win_later __ARGS((win_T *wp, int type));
 void redraw_later_clear __ARGS((void));
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -183,6 +183,15 @@ static void win_redr_ruler __ARGS((win_T
 static int screen_char_attr = 0;
 #endif
 
+/* Force redraw of window, if it has relative number set */
+    void
+redraw_relnumber_win(wp)
+    win_T *wp;
+{
+    if (wp->w_p_rnu)
+	redraw_win_later(wp, SOME_VALID);
+}
+
 /*
  * Redraw the current window later, with update_screen(type).
  * Set must_redraw only if not already set to a higher value.

Raspunde prin e-mail lui