aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-08-20 18:53:58 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-08-20 20:01:22 +0200
commitcc7e344f8357d07b1df17df0b322152d5c50739b (patch)
treec0132e0077137286e5101e20c58ef1a719dae919 /src/nvim/message.c
parent9882e25dc44f1165e1edc8b3898356e493b6b3fe (diff)
downloadrneovim-cc7e344f8357d07b1df17df0b322152d5c50739b.tar.gz
rneovim-cc7e344f8357d07b1df17df0b322152d5c50739b.tar.bz2
rneovim-cc7e344f8357d07b1df17df0b322152d5c50739b.zip
clipboard: remove start_batch_changes() in redir_write()
start_batch_changes() doesn't avoid invoking the clipboard once-per-line, because the loop is actually in ex_echo(), which calls redir_write() for each message. But we've already entered start_batch_changes() by then, so that was never the problem. redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523 msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600 msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221 ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433 do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242 Trying to defer _explicit_ clipboard updates is difficult. :redir @+ | silent echo system('cat foo') | redir END is essentially equivalent to: for l in readfile('foo') let @+ .= l endfor We cannot make judgements about when to ignore a script's bad decisions. start_batch_changes() only works around the case of clipboard=unnamed, i.e. _implicit_ clipboard updates (`:g/foo/d`). Not explicit assignment.
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c2
1 files changed, 0 insertions, 2 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;