diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-01-08 20:37:35 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-01-08 23:31:48 +0100 |
commit | 94525320365323f94cba93dce6926c3b1b062078 (patch) | |
tree | e490e671232bf774ba9763a184fbd8a839fec3e9 /src | |
parent | c8e78abaf9c35c07cab8825a8f59e81a06e9ad50 (diff) | |
download | rneovim-94525320365323f94cba93dce6926c3b1b062078.tar.gz rneovim-94525320365323f94cba93dce6926c3b1b062078.tar.bz2 rneovim-94525320365323f94cba93dce6926c3b1b062078.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/vim.c | 1 | ||||
-rw-r--r-- | src/nvim/api/window.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 2a724a85ec..796923ffcb 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -75,7 +75,6 @@ void nvim_command(String command, Error *err) { try_start(); do_cmdline_cmd(command.data); - update_screen(VALID); try_end(err); } diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index cf1d1f5e45..33857f95b7 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -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 |