Skip to content

Instantly share code, notes, and snippets.

@h-east
Created January 14, 2018 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h-east/c9043fbc75c599c4cd31003f533f30e5 to your computer and use it in GitHub Desktop.
Save h-east/c9043fbc75c599c4cd31003f533f30e5 to your computer and use it in GitHub Desktop.
diff --git a/src/normal.c b/src/normal.c
index 745a2f68c..18665771b 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1898,9 +1898,12 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
else
{
#ifdef FEAT_LINEBREAK
- curwin->w_p_lbr = lbr_saved;
+ curwin->w_p_lbr = FALSE;
#endif
(void)op_yank(oap, FALSE, !gui_yank);
+#ifdef FEAT_LINEBREAK
+ curwin->w_p_lbr = lbr_saved;
+#endif
}
check_cursor_col();
break;
@@ -2073,18 +2076,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
}
#ifdef FEAT_VISUALEXTRA
else
- {
-# ifdef FEAT_LINEBREAK
- /* Restore linebreak, so that when the user edits it looks as
- * before. */
- if (curwin->w_p_lbr != lbr_saved)
- {
- curwin->w_p_lbr = lbr_saved;
- get_op_vcol(oap, redo_VIsual_mode, FALSE);
- }
-# endif
op_replace(oap, cap->nchar);
- }
#endif
break;
@@ -2124,11 +2116,11 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
else
{
VIsual_active = TRUE;
+ op_addsub(oap, cap->count1, redo_VIsual_arg);
+ VIsual_active = FALSE;
#ifdef FEAT_LINEBREAK
curwin->w_p_lbr = lbr_saved;
#endif
- op_addsub(oap, cap->count1, redo_VIsual_arg);
- VIsual_active = FALSE;
}
check_cursor_col();
break;
diff --git a/src/ops.c b/src/ops.c
index 83c36bda6..4be46dcb2 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -5497,7 +5497,7 @@ op_addsub(
{
if (oap->block_mode) /* Visual block mode */
{
- block_prep(oap, &bd, pos.lnum, FALSE);
+ block_prep(oap, &bd, pos.lnum, TRUE);
pos.col = bd.textcol;
length = bd.textlen;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment