summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-03 22:58:08 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-03 22:58:08 +0100
commit5823f84dd04198994e3e5f2e278a5e315c47d32d (patch)
treefe0ab932c103caff2e534912c98171a467ed87cb
parentf2d79fa92d0ed90732f52dd88da4ad66c2c5ce13 (diff)
patch 8.1.0686: when 'y' is in 'cpoptions' yanking for the clipboard changes redov8.1.0686
Problem: When 'y' is in 'cpoptions' yanking for the clipboard changes redo. Solution: Do not use the 'y' flag when "gui_yank" is TRUE. (Andy Massimino, closes #3760)
-rw-r--r--src/normal.c11
-rw-r--r--src/version.c2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/normal.c b/src/normal.c
index 77191c67ee..2688bf9f59 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1326,7 +1326,8 @@ set_vcount_ca(cmdarg_T *cap, int *set_prevcount)
#endif
/*
- * Handle an operator after visual mode or when the movement is finished
+ * Handle an operator after Visual mode or when the movement is finished.
+ * "gui_yank" is true when yanking text for the clipboard.
*/
void
do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
@@ -1372,6 +1373,10 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
*/
if ((finish_op || VIsual_active) && oap->op_type != OP_NOP)
{
+ // Yank can be redone when 'y' is in 'cpoptions', but not when yanking
+ // for the clipboard.
+ int redo_yank = vim_strchr(p_cpo, CPO_YANK) != NULL && !gui_yank;
+
#ifdef FEAT_LINEBREAK
/* Avoid a problem with unwanted linebreaks in block mode. */
if (curwin->w_p_lbr)
@@ -1407,7 +1412,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
/* Only redo yank when 'y' flag is in 'cpoptions'. */
/* Never redo "zf" (define fold). */
- if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK)
+ if ((redo_yank || oap->op_type != OP_YANK)
&& ((!VIsual_active || oap->motion_force)
/* Also redo Operator-pending Visual mode mappings */
|| (VIsual_active && cap->cmdchar == ':'
@@ -1628,7 +1633,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
}
/* can't redo yank (unless 'y' is in 'cpoptions') and ":" */
- if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK)
+ if ((redo_yank || oap->op_type != OP_YANK)
&& oap->op_type != OP_COLON
#ifdef FEAT_FOLDING
&& oap->op_type != OP_FOLD
diff --git a/src/version.c b/src/version.c
index b9fe30174c..62edc78bc7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -800,6 +800,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 686,
+/**/
685,
/**/
684,