From: Witold Filipczyk Date: Wed, 8 Aug 2007 12:39:22 +0000 (+0200) Subject: Avoid flickering when moving past the main view's first and last line X-Git-Tag: tig-0.9~38 X-Git-Url: https://git.distorted.org.uk/~mdw/tig/commitdiff_plain/034001361c7764dacf9cc75dc999eafc25a72637?ds=inline;hp=56b6ea55c47e7dfeb6edd13f8a9702ca78256114 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 --- 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;