mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
69d7e864e9
commit
d4acb0df2f
38
src/normal.c
38
src/normal.c
@ -5248,10 +5248,42 @@ static void nv_brackets(cmdarg_T *cap)
|
|||||||
*/
|
*/
|
||||||
else if (cap->nchar == 'p' || cap->nchar == 'P') {
|
else if (cap->nchar == 'p' || cap->nchar == 'P') {
|
||||||
if (!checkclearop(cap->oap)) {
|
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);
|
prep_redo_cmd(cap);
|
||||||
do_put(cap->oap->regname,
|
do_put(regname, dir, cap->count1, PUT_FIXINDENT);
|
||||||
(cap->cmdchar == ']' && cap->nchar == 'p') ? FORWARD : BACKWARD,
|
if (was_visual) {
|
||||||
cap->count1, PUT_FIXINDENT);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -202,6 +202,12 @@ 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,
|
||||||
|
//197,
|
||||||
|
//196,
|
||||||
|
//195,
|
||||||
|
//194,
|
||||||
192,
|
192,
|
||||||
//191,
|
//191,
|
||||||
//190,
|
//190,
|
||||||
|
Loading…
Reference in New Issue
Block a user