diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-02-10 20:09:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-10 20:09:14 +0100 |
commit | 84328bae08e0694c2409b1506116275770830745 (patch) | |
tree | 6a84d845cd9c8ec0100238b4be482051d88edfa9 /src/nvim/autocmd.c | |
parent | e5d8220179f932ab9c9ef59996cab357a25eaaf8 (diff) | |
parent | 30b29a36e80bfeed50bb6ea618401fe35100490f (diff) | |
download | rneovim-84328bae08e0694c2409b1506116275770830745.tar.gz rneovim-84328bae08e0694c2409b1506116275770830745.tar.bz2 rneovim-84328bae08e0694c2409b1506116275770830745.zip |
Merge pull request #22194 from bfredl/noflush
refactor(ui): remove some superfluous redraw and ui_flush() calls
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r-- | src/nvim/autocmd.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 897c9533e5..0485fbcdb0 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -2740,14 +2740,12 @@ void do_autocmd_focusgained(bool gained) { static bool recursive = false; static Timestamp last_time = (time_t)0; - bool need_redraw = false; if (recursive) { return; // disallow recursion } recursive = true; - need_redraw |= apply_autocmds((gained ? EVENT_FOCUSGAINED : EVENT_FOCUSLOST), - NULL, NULL, false, curbuf); + apply_autocmds((gained ? EVENT_FOCUSGAINED : EVENT_FOCUSLOST), NULL, NULL, false, curbuf); // When activated: Check if any file was modified outside of Vim. // Only do this when not done within the last two seconds as: @@ -2755,32 +2753,10 @@ void do_autocmd_focusgained(bool gained) // has a granularity of 2 seconds. // 2. We could get multiple notifications in a row. if (gained && last_time + (Timestamp)2000 < os_now()) { - need_redraw = check_timestamps(true); + check_timestamps(true); last_time = os_now(); } - if (need_redraw) { - // Something was executed, make sure the cursor is put back where it - // belongs. - need_wait_return = false; - - if (State & MODE_CMDLINE) { - redrawcmdline(); - } else if ((State & MODE_NORMAL) || (State & MODE_INSERT)) { - if (must_redraw != 0) { - update_screen(); - } - - setcursor(); - } - - ui_flush(); - } - - if (need_maketitle) { - maketitle(); - } - recursive = false; } |