Hi Nazri!
On Di, 25 Nov 2014, Nazri Ramliy wrote:
> On Tue, Nov 25, 2014 at 2:33 PM, Christian Brabandt <[email protected]>
> wrote:
> > Am 2014-11-25 02:58, schrieb Nazri Ramliy:
> > Isn't that the same bug, you reported last week at
> > https://groups.google.com/d/msg/vim_dev/qORtSGBSnkc/o3pMwJ1Z1A4J
> > (Bug 2)?
>
> No I don't think it's the same bug since this bug is still
> reproducible after applying the two patches that you submitted for
> fixing Bug 1 and Bug 2 that I reported last week.
You are a good tester ;)
That bug you reported actually is the same, just that the mentioned
patch does not fix it for your situation. (since I forgot to reset the
linebreak for the couple of times, where the screen is redrawn. That
should be fixed with this patch).
Here is an update. Please test with that patch (should apply cleanly on
top of master).
Bram, this patch replaces the one I created earlier in:
https://groups.google.com/forum/#!msg/vim_dev/kv5kg0fZxRQ/1grx0E-XlIUJ
Best,
Christian
--
Eine schöne Frau gefällt den Augen, eine gute dem Herzen, die eine ist
ein Kleinod, die andere ein Schatz.
-- Napoleon I. Bonaparte
--
--
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/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -1393,10 +1393,6 @@ do_pending_operator(cap, old_col, gui_ya
int include_line_break = FALSE;
#endif
-#ifdef FEAT_LINEBREAK
- curwin->w_p_lbr = FALSE; /* Avoid a problem with unwanted linebreaks in
- * block mode. */
-#endif
#if defined(FEAT_CLIPBOARD)
/*
* Yank the visual area into the GUI selection register before we operate
@@ -1420,6 +1416,10 @@ do_pending_operator(cap, old_col, gui_ya
*/
if ((finish_op || VIsual_active) && oap->op_type != OP_NOP)
{
+#ifdef FEAT_LINEBREAK
+ /* Avoid a problem with unwanted linebreaks in block mode. */
+ curwin->w_p_lbr = FALSE;
+#endif
oap->is_VIsual = VIsual_active;
if (oap->motion_force == 'V')
oap->motion_type = MLINE;
@@ -1819,7 +1819,13 @@ do_pending_operator(cap, old_col, gui_ya
|| oap->op_type == OP_FUNCTION
|| oap->op_type == OP_FILTER)
&& oap->motion_force == NUL)
+ {
+#ifdef FEAT_LINEBREAK
+ /* make sure, redrawing is correct */
+ curwin->w_p_lbr = lbr_saved;
+#endif
redraw_curbuf_later(INVERTED);
+ }
}
}
@@ -1863,7 +1869,12 @@ do_pending_operator(cap, old_col, gui_ya
|| oap->op_type == OP_FOLD
#endif
))
+ {
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = lbr_saved;
+#endif
redraw_curbuf_later(INVERTED);
+ }
/*
* If the end of an operator is in column one while oap->motion_type
@@ -1948,6 +1959,9 @@ do_pending_operator(cap, old_col, gui_ya
}
else
(void)op_yank(oap, FALSE, !gui_yank);
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = lbr_saved;
+#endif
check_cursor_col();
break;
@@ -1969,6 +1983,10 @@ do_pending_operator(cap, old_col, gui_ya
else
restart_edit_save = 0;
restart_edit = 0;
+#ifdef FEAT_LINEBREAK
+ /* Restore linebreak, so that when the user edits it looks as before */
+ curwin->w_p_lbr = lbr_saved;
+#endif
/* Reset finish_op now, don't want it set inside edit(). */
finish_op = FALSE;
if (op_change(oap)) /* will call edit() */
@@ -2064,8 +2082,15 @@ do_pending_operator(cap, old_col, gui_ya
* Visual mode. But do this only once. */
restart_edit_save = restart_edit;
restart_edit = 0;
-
+#ifdef FEAT_LINEBREAK
+ /* Restore linebreak, so that when the user edits it looks as before */
+ curwin->w_p_lbr = lbr_saved;
+#endif
op_insert(oap, cap->count1);
+#ifdef FEAT_LINEBREAK
+ /* Reset linebreak, so that formatting works correctly */
+ curwin->w_p_lbr = FALSE;
+#endif
/* TODO: when inserting in several lines, should format all
* the lines. */
@@ -2090,7 +2115,13 @@ do_pending_operator(cap, old_col, gui_ya
}
#ifdef FEAT_VISUALEXTRA
else
+ {
+#ifdef FEAT_LINEBREAK
+ /* Restore linebreak, so that when the user edits it looks as before */
+ curwin->w_p_lbr = lbr_saved;
+#endif
op_replace(oap, cap->nchar);
+ }
#endif
break;
@@ -2134,7 +2165,12 @@ do_pending_operator(cap, old_col, gui_ya
if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted
&& (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT
|| oap->op_type == OP_DELETE))
+ {
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = FALSE;
+#endif
coladvance(curwin->w_curswant = old_col);
+ }
}
else
{