mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.4.576
Problem: Redrawing problem with 'relativenumber' and 'linebreak'. Solution: Temporarily reset 'linebreak' and restore it in more places. (Christian Brabandt)
This commit is contained in:
51
src/normal.c
51
src/normal.c
@@ -1393,10 +1393,6 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
int include_line_break = FALSE;
|
int include_line_break = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_LINEBREAK
|
|
||||||
curwin->w_p_lbr = FALSE; /* Avoid a problem with unwanted linebreaks in
|
|
||||||
* block mode. */
|
|
||||||
#endif
|
|
||||||
#if defined(FEAT_CLIPBOARD)
|
#if defined(FEAT_CLIPBOARD)
|
||||||
/*
|
/*
|
||||||
* Yank the visual area into the GUI selection register before we operate
|
* Yank the visual area into the GUI selection register before we operate
|
||||||
@@ -1420,6 +1416,10 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
*/
|
*/
|
||||||
if ((finish_op || VIsual_active) && oap->op_type != OP_NOP)
|
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;
|
oap->is_VIsual = VIsual_active;
|
||||||
if (oap->motion_force == 'V')
|
if (oap->motion_force == 'V')
|
||||||
oap->motion_type = MLINE;
|
oap->motion_type = MLINE;
|
||||||
@@ -1819,9 +1819,15 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
|| oap->op_type == OP_FUNCTION
|
|| oap->op_type == OP_FUNCTION
|
||||||
|| oap->op_type == OP_FILTER)
|
|| oap->op_type == OP_FILTER)
|
||||||
&& oap->motion_force == NUL)
|
&& oap->motion_force == NUL)
|
||||||
|
{
|
||||||
|
#ifdef FEAT_LINEBREAK
|
||||||
|
/* make sure redrawing is correct */
|
||||||
|
curwin->w_p_lbr = lbr_saved;
|
||||||
|
#endif
|
||||||
redraw_curbuf_later(INVERTED);
|
redraw_curbuf_later(INVERTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
/* Include the trailing byte of a multi-byte char. */
|
/* Include the trailing byte of a multi-byte char. */
|
||||||
@@ -1863,7 +1869,12 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
|| oap->op_type == OP_FOLD
|
|| oap->op_type == OP_FOLD
|
||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
|
{
|
||||||
|
#ifdef FEAT_LINEBREAK
|
||||||
|
curwin->w_p_lbr = lbr_saved;
|
||||||
|
#endif
|
||||||
redraw_curbuf_later(INVERTED);
|
redraw_curbuf_later(INVERTED);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the end of an operator is in column one while oap->motion_type
|
* If the end of an operator is in column one while oap->motion_type
|
||||||
@@ -1947,7 +1958,12 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
#ifdef FEAT_LINEBREAK
|
||||||
|
curwin->w_p_lbr = lbr_saved;
|
||||||
|
#endif
|
||||||
(void)op_yank(oap, FALSE, !gui_yank);
|
(void)op_yank(oap, FALSE, !gui_yank);
|
||||||
|
}
|
||||||
check_cursor_col();
|
check_cursor_col();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1969,6 +1985,11 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
else
|
else
|
||||||
restart_edit_save = 0;
|
restart_edit_save = 0;
|
||||||
restart_edit = 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(). */
|
/* Reset finish_op now, don't want it set inside edit(). */
|
||||||
finish_op = FALSE;
|
finish_op = FALSE;
|
||||||
if (op_change(oap)) /* will call edit() */
|
if (op_change(oap)) /* will call edit() */
|
||||||
@@ -2064,8 +2085,16 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
* Visual mode. But do this only once. */
|
* Visual mode. But do this only once. */
|
||||||
restart_edit_save = restart_edit;
|
restart_edit_save = restart_edit;
|
||||||
restart_edit = 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
|
||||||
op_insert(oap, cap->count1);
|
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
|
/* TODO: when inserting in several lines, should format all
|
||||||
* the lines. */
|
* the lines. */
|
||||||
@@ -2090,7 +2119,14 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
}
|
}
|
||||||
#ifdef FEAT_VISUALEXTRA
|
#ifdef FEAT_VISUALEXTRA
|
||||||
else
|
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);
|
op_replace(oap, cap->nchar);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2134,8 +2170,13 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted
|
if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted
|
||||||
&& (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT
|
&& (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT
|
||||||
|| oap->op_type == OP_DELETE))
|
|| oap->op_type == OP_DELETE))
|
||||||
|
{
|
||||||
|
#ifdef FEAT_LINEBREAK
|
||||||
|
curwin->w_p_lbr = FALSE;
|
||||||
|
#endif
|
||||||
coladvance(curwin->w_curswant = old_col);
|
coladvance(curwin->w_curswant = old_col);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
curwin->w_cursor = old_cursor;
|
curwin->w_cursor = old_cursor;
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
576,
|
||||||
/**/
|
/**/
|
||||||
575,
|
575,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user