mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
paste: tickle cursor
HACK: The cursor does not get repositioned after the paste completes. Scheduling a dummy event seems to fix it. Test case: 0. Revert this commit. 1. Paste some text in Normal-mode. 2. Notice the cursor is still in the cmdline area.
This commit is contained in:
@@ -1252,11 +1252,15 @@ Boolean nvim_paste(String data, Integer phase, Error *err)
|
||||
}
|
||||
}
|
||||
}
|
||||
api_free_object(rv);
|
||||
api_free_array(args);
|
||||
if (!(State & CMDLINE) && !(State & INSERT) && (phase == -1 || phase == 3)) {
|
||||
AppendCharToRedobuff(ESC); // Dot-repeat.
|
||||
}
|
||||
api_free_object(rv);
|
||||
api_free_array(args);
|
||||
if (phase == -1 || phase == 3) {
|
||||
// XXX: Tickle main loop to ensure cursor is updated.
|
||||
loop_schedule_deferred(&main_loop, event_create(loop_dummy_event, 0));
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
Reference in New Issue
Block a user