aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index a498fc481a..e8a79fa820 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -339,10 +339,16 @@ static void shift_block(oparg_T *oap, int amount)
total += bd.pre_whitesp; /* all virtual WS up to & incl a split TAB */
ws_vcol = bd.start_vcol - bd.pre_whitesp;
if (bd.startspaces) {
- if (has_mbyte)
- bd.textstart += (*mb_ptr2len)(bd.textstart);
- else
- ++bd.textstart;
+ if (has_mbyte) {
+ if ((*mb_ptr2len)(bd.textstart) == 1) {
+ bd.textstart++;
+ } else {
+ ws_vcol = 0;
+ bd.startspaces = 0;
+ }
+ } else {
+ bd.textstart++;
+ }
}
for (; ascii_iswhite(*bd.textstart); ) {
// TODO: is passing bd.textstart for start of the line OK?
@@ -5452,7 +5458,7 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing)
yankreg_T *target;
if (cb_flags & CB_UNNAMEDPLUS) {
- *name = cb_flags & CB_UNNAMED ? '"': '+';
+ *name = (cb_flags & CB_UNNAMED && writing) ? '"': '+';
target = &y_regs[PLUS_REGISTER];
} else {
*name = '*';