mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.4.199
Problem: (issue 197) ]P doesn't paste over Visual selection. Solution: Handle Visual mode specifically. (Christian Brabandt)
This commit is contained in:
54
src/normal.c
54
src/normal.c
@@ -6751,10 +6751,58 @@ nv_brackets(cap)
|
|||||||
{
|
{
|
||||||
if (!checkclearop(cap->oap))
|
if (!checkclearop(cap->oap))
|
||||||
{
|
{
|
||||||
|
int dir = (cap->cmdchar == ']' && cap->nchar == 'p')
|
||||||
|
? FORWARD : BACKWARD;
|
||||||
|
int regname = cap->oap->regname;
|
||||||
|
#ifdef FEAT_VISUAL
|
||||||
|
int was_visual = VIsual_active;
|
||||||
|
int line_count = curbuf->b_ml.ml_line_count;
|
||||||
|
pos_T start, end;
|
||||||
|
|
||||||
|
if (VIsual_active)
|
||||||
|
{
|
||||||
|
start = ltoreq(VIsual, curwin->w_cursor)
|
||||||
|
? VIsual : curwin->w_cursor;
|
||||||
|
end = equalpos(start,VIsual) ? curwin->w_cursor : VIsual;
|
||||||
|
curwin->w_cursor = (dir == BACKWARD ? start : end);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
# ifdef FEAT_CLIPBOARD
|
||||||
|
adjust_clip_reg(®name);
|
||||||
|
# endif
|
||||||
prep_redo_cmd(cap);
|
prep_redo_cmd(cap);
|
||||||
do_put(cap->oap->regname,
|
|
||||||
(cap->cmdchar == ']' && cap->nchar == 'p') ? FORWARD : BACKWARD,
|
do_put(regname, dir, cap->count1, PUT_FIXINDENT);
|
||||||
cap->count1, PUT_FIXINDENT);
|
#ifdef FEAT_VISUAL
|
||||||
|
if (was_visual)
|
||||||
|
{
|
||||||
|
VIsual = start;
|
||||||
|
curwin->w_cursor = end;
|
||||||
|
if (dir == BACKWARD)
|
||||||
|
{
|
||||||
|
/* adjust lines */
|
||||||
|
VIsual.lnum += curbuf->b_ml.ml_line_count - line_count;
|
||||||
|
curwin->w_cursor.lnum +=
|
||||||
|
curbuf->b_ml.ml_line_count - line_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
VIsual_active = TRUE;
|
||||||
|
if (VIsual_mode == 'V')
|
||||||
|
{
|
||||||
|
/* delete visually selected lines */
|
||||||
|
cap->cmdchar = 'd';
|
||||||
|
cap->nchar = NUL;
|
||||||
|
cap->oap->regname = regname;
|
||||||
|
nv_operator(cap);
|
||||||
|
do_pending_operator(cap, 0, FALSE);
|
||||||
|
}
|
||||||
|
if (VIsual_active)
|
||||||
|
{
|
||||||
|
end_visual_mode();
|
||||||
|
redraw_later(SOME_VALID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -738,6 +738,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 */
|
||||||
|
/**/
|
||||||
|
199,
|
||||||
/**/
|
/**/
|
||||||
198,
|
198,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user