vim-patch 7.4.199

Problem:    ]P doesn't paste over Visual selection.
Solution:   Handle Visual mode specifically. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=54b1a90c937380195fad6a52408aa3b4eed6d8d1
This commit is contained in:
Keerthan Jaic 2014-04-07 14:11:19 -04:00 committed by Thiago de Arruda
parent 69d7e864e9
commit d4acb0df2f
2 changed files with 41 additions and 3 deletions

View File

@ -5248,10 +5248,42 @@ static void nv_brackets(cmdarg_T *cap)
*/
else if (cap->nchar == 'p' || cap->nchar == 'P') {
if (!checkclearop(cap->oap)) {
int dir = (cap->cmdchar == ']' && cap->nchar == 'p') ? FORWARD : BACKWARD;
int regname = cap->oap->regname;
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);
}
prep_redo_cmd(cap);
do_put(cap->oap->regname,
(cap->cmdchar == ']' && cap->nchar == 'p') ? FORWARD : BACKWARD,
cap->count1, PUT_FIXINDENT);
do_put(regname, dir, cap->count1, PUT_FIXINDENT);
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);
}
}
}
}
/*

View File

@ -202,6 +202,12 @@ static char *(features[]) = {
static int included_patches[] = {
// Add new patch number below this line
199,
//198,
//197,
//196,
//195,
//194,
192,
//191,
//190,