mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
API: don't directly call update_screen() in API functions
There is no need to call update_screen() directly in an API function, mode input processing invokes update_screen() as needed. And if the API call is done in a context where redraw is disabled, then redraw is disabled for a reason. A lot of API functions are of equal semantical strength (nvim_call_function and nvim_execute_lua can also do whatever, nvim_command is not special), this inconsistency has no purpose.
This commit is contained in:
@@ -75,7 +75,6 @@ void nvim_command(String command, Error *err)
|
||||
{
|
||||
try_start();
|
||||
do_cmdline_cmd(command.data);
|
||||
update_screen(VALID);
|
||||
try_end(err);
|
||||
}
|
||||
|
||||
|
@@ -135,7 +135,7 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err)
|
||||
// make sure cursor is in visible range even if win != curwin
|
||||
update_topline_win(win);
|
||||
|
||||
update_screen(VALID);
|
||||
redraw_win_later(win, VALID);
|
||||
}
|
||||
|
||||
/// Gets the window height
|
||||
|
Reference in New Issue
Block a user