diff options
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 79a7271819..216bab4dda 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3001,9 +3001,10 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) /* add a new line */ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) { if (ml_append(curbuf->b_ml.ml_line_count, (char_u *)"", - (colnr_T)1, FALSE) == FAIL) + (colnr_T)1, false) == FAIL) { break; - ++nr_lines; + } + nr_lines++; } /* get the old line and advance to the position to insert at */ oldp = get_cursor_line_ptr(); @@ -3190,8 +3191,8 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) newp = (char_u *) xmalloc((size_t)(STRLEN(ptr) + totlen + 1)); STRCPY(newp, y_array[y_size - 1]); STRCAT(newp, ptr); - /* insert second line */ - ml_append(lnum, newp, (colnr_T)0, FALSE); + // insert second line + ml_append(lnum, newp, (colnr_T)0, false); xfree(newp); oldp = ml_get(lnum); @@ -5616,6 +5617,9 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing) if (explicit_cb_reg) { target = &y_regs[*name == '*' ? STAR_REGISTER : PLUS_REGISTER]; + if (writing && (cb_flags & (*name == '*' ? CB_UNNAMED : CB_UNNAMEDPLUS))) { + clipboard_needs_update = false; + } goto end; } else { // unnamed register: "implicit" clipboard if (writing && clipboard_delay_update) { |