X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/9f396969d5163421c4ceb9628aa1ed63878d94ac..85af62849a84b08f783c70d6e3f25b5175188d68:/tig.c?ds=inline diff --git a/tig.c b/tig.c index 975e7dc..f744657 100644 --- a/tig.c +++ b/tig.c @@ -906,7 +906,6 @@ resize_display(void) wresize(view->win, view->height, view->width); mvwin(view->win, offset, 0); mvwin(view->title, offset + view->height, 0); - wrefresh(view->win); } offset += view->height + 1; @@ -925,6 +924,20 @@ redraw_display(void) } } +static void +update_display_cursor(void) +{ + struct view *view = display[current_view]; + + /* Move the cursor to the right-most column of the cursor line. + * + * XXX: This could turn out to be a bit expensive, but it ensures that + * the cursor does not jump around. */ + if (view->lines) { + wmove(view->win, view->lineno - view->offset, view->width - 1); + wrefresh(view->win); + } +} /* * Navigation @@ -1344,7 +1357,7 @@ open_view(struct view *prev, enum request request, enum open_flags flags) } if (prev && view != prev) { - if (!backgrounded) { + if (split && !backgrounded) { /* "Blur" the previous view. */ update_view_title(prev); } @@ -2205,15 +2218,7 @@ report(const char *msg, ...) } update_view_title(view); - - /* Move the cursor to the right-most column of the cursor line. - * - * XXX: This could turn out to be a bit expensive, but it ensures that - * the cursor does not jump around. */ - if (view->lines) { - wmove(view->win, view->lineno - view->offset, view->width - 1); - wrefresh(view->win); - } + update_display_cursor(); } /* Controls when nodelay should be in effect when polling user input. */