From 4ed67514df1103bfaeec3d549578e59cead74151 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 22 Mar 2008 21:35:31 +0100 Subject: [PATCH] Add hack to allow view loading to have multiple phases .. by avoiding end_update() call after last read line. --- tig.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tig.c b/tig.c index f8132fd..2551ba3 100644 --- a/tig.c +++ b/tig.c @@ -2234,8 +2234,8 @@ alloc_error: report("Allocation failure"); end: - view->ops->read(view, NULL); - end_update(view); + if (view->ops->read(view, NULL)) + end_update(view); return FALSE; } @@ -3077,6 +3077,8 @@ tree_read(struct view *view, char *text) enum line_type type; bool first_read = view->lines == 0; + if (!text) + return TRUE; if (textlen <= SIZEOF_TREE_ATTR) return FALSE; -- 2.30.2