From 613296936ba30ae73f3391c2e3c36096f3703c06 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 20 Aug 2019 22:41:21 +0200 Subject: API: nvim_put: always PUT_CURSEND Fixes strange behavior where sometimes the buffer contents of a series of paste chunks (vim._paste) would be out-of-order. Now the tui_spec.lua screen-tests are much more reliable. But they still sometimes fail because of off-by-one cursor (caused by "typeahead race" resulting in wrong mode; fixed later in this patch-series). --- src/nvim/api/vim.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 900c3bab58..d3e368d01b 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1249,13 +1249,7 @@ void nvim_put(ArrayOf(String) lines, String type, Boolean direction, finish_yankreg_from_object(reg, false); bool VIsual_was_active = VIsual_active; - int flags = 0; - if (State & INSERT) { - flags |= PUT_CURSEND; - } else if (VIsual_active) { - // TODO: fix VIsual when cursor is before, or emulate the delete as well - flags |= lt(VIsual, curwin->w_cursor) ? PUT_CURSEND : 0; - } + int flags = PUT_CURSEND; msg_silent++; // Avoid "N more lines" message. do_put(0, reg, direction ? BACKWARD : FORWARD, 1, flags); msg_silent--; -- cgit