From 04b914dcb09aab11f764d55079a939194ec010fc Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Mon, 13 Jun 2022 00:17:05 +0200 Subject: [PATCH] fix visible lines expiring from cache --- src/fe-text/textbuffer-view.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index eb7db164..a28df7b5 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -1494,12 +1494,18 @@ static int line_cache_check_remove(void *key, LINE_CACHE_REC *cache, static int sig_check_linecache(void) { GSList *tmp, *caches; - time_t now; + time_t now; - now = time(NULL); caches = NULL; + now = time(NULL); + caches = NULL; for (tmp = views; tmp != NULL; tmp = tmp->next) { TEXT_BUFFER_VIEW_REC *rec = tmp->data; + if (rec->window != NULL) { + /* keep visible lines mapped */ + view_get_lines_height(rec, rec->startline, rec->subline, NULL); + } + if (g_slist_find(caches, rec->cache) != NULL) continue; @@ -1509,7 +1515,7 @@ static int sig_check_linecache(void) &now); } - g_slist_free(caches); + g_slist_free(caches); return 1; }