aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c2
-rw-r--r--src/nvim/ops.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index fe4cb65779..b90c475ede 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -2519,7 +2519,6 @@ static void redir_write(const char *const str, const ptrdiff_t maxlen)
if (redirecting()) {
/* If the string doesn't start with CR or NL, go to msg_col */
if (*s != '\n' && *s != '\r') {
- start_batch_changes();
while (cur_col < msg_col) {
if (capture_ga) {
ga_concat_len(capture_ga, " ", 1);
@@ -2536,7 +2535,6 @@ static void redir_write(const char *const str, const ptrdiff_t maxlen)
}
cur_col++;
}
- end_batch_changes();
}
size_t len = maxlen == -1 ? STRLEN(s) : (size_t)maxlen;
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 7bbc72b091..6c873a96c0 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -5558,7 +5558,7 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing)
msg((char_u *)MSG_NO_CLIP);
clipboard_didwarn_unnamed = true;
}
- // ... else, be silent (avoid a flood of messages).
+ // ... else, be silent (don't flood during :while, :redir, etc.).
goto end;
}
@@ -5567,10 +5567,12 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing)
goto end;
} else { // unnamed register: "implicit" clipboard
if (writing && clipboard_delay_update) {
+ // For "set" (copy), defer the clipboard call.
clipboard_needs_update = true;
goto end;
} else if (!writing && clipboard_needs_update) {
- goto end; // use the internal value
+ // For "get" (paste), use the internal value.
+ goto end;
}
if (cb_flags & CB_UNNAMEDPLUS) {
@@ -5772,6 +5774,7 @@ void end_batch_changes(void)
}
clipboard_delay_update = false;
if (clipboard_needs_update) {
+ // unnamed ("implicit" clipboard)
set_clipboard(NUL, y_previous);
clipboard_needs_update = false;
}