diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-08-20 02:13:04 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-08-20 19:49:42 +0200 |
commit | 9882e25dc44f1165e1edc8b3898356e493b6b3fe (patch) | |
tree | c4275fc02a6b8be8c060b0997cbeb59244e50b8e /src/nvim/message.c | |
parent | b3da396804ec0a63f11b86a363bd4c98e23f8ebd (diff) | |
download | rneovim-9882e25dc44f1165e1edc8b3898356e493b6b3fe.tar.gz rneovim-9882e25dc44f1165e1edc8b3898356e493b6b3fe.tar.bz2 rneovim-9882e25dc44f1165e1edc8b3898356e493b6b3fe.zip |
clipboard: avoid error flood during :redir
redir_write():
- This is a "batch" operation which was not yet covered by
start_batch_changes()
adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
Rather than deal with the mess, show a non-error message.
closes #7182
closes #7184
closes #7183
ref #6048
ref #7032
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index b90c475ede..fe4cb65779 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -2519,6 +2519,7 @@ 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); @@ -2535,6 +2536,7 @@ 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; |