From 034001361c7764dacf9cc75dc999eafc25a72637 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Wed, 8 Aug 2007 14:39:22 +0200 Subject: [PATCH] Avoid flickering when moving past the main view's first and last line In diff mode when first or last item is displayed KEY_UP or KEY_DOWN respectively cause flickering. I know that I should not press those keys in that situation, but this annoys me anyway. Signed-off-by: Jonas Fonseca --- tig.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tig.c b/tig.c index fa2a708..465de23 100644 --- a/tig.c +++ b/tig.c @@ -2177,10 +2177,15 @@ view_driver(struct view *view, enum request request) view->parent == VIEW(REQ_VIEW_MAIN)) || (view == VIEW(REQ_VIEW_BLOB) && view->parent == VIEW(REQ_VIEW_TREE))) { + int line; + view = view->parent; + line = view->lineno; move_view(view, request); if (view_is_displayed(view)) update_view_title(view); + if (line == view->lineno) + break; } else { move_view(view, request); break; -- 2.30.2