perf(statusline): UI elements are always redrawn on K_EVENT

Problem:    'statusline'-format UI elements are redrawn on each K_EVENT.
Solution:   Only redraw UI elements when something relevant has changed.
This commit is contained in:
Luuk van Baal
2023-03-08 12:36:03 +01:00
parent 1fb585a9db
commit fe11079721
7 changed files with 167 additions and 151 deletions

View File

@@ -49,6 +49,7 @@
#include "nvim/spell.h"
#include "nvim/spellfile.h"
#include "nvim/spellsuggest.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/ui.h"
@@ -1220,6 +1221,7 @@ static void did_set_statusline(win_T *win, char **varp, char **gvarp, char **err
}
if (varp == &p_ruf && *errmsg == NULL) {
comp_col();
win_redr_ruler(curwin);
}
// add / remove window bars for 'winbar'
if (gvarp == &p_wbr) {