From: Jonas Fonseca Date: Sun, 15 Feb 2009 16:28:12 +0000 (+0100) Subject: Remove limitation of horizontal scrolling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=93a489f3b538aa250ff00559500c57f2461cdbe3;p=tig.git Remove limitation of horizontal scrolling Tig now behaves similar to less in that the user can scroll without limit to the right. --- diff --git a/tig.c b/tig.c index 1b5f0f2..9c6cf01 100644 --- a/tig.c +++ b/tig.c @@ -1771,7 +1771,6 @@ struct view { enum line_type curtype; /* Attribute currently used for drawing. */ unsigned long col; /* Column when drawing. */ bool has_scrolled; /* View was scrolled. */ - bool can_hscroll; /* View can be scrolled horizontally. */ /* Loading */ struct io io; @@ -1892,9 +1891,6 @@ draw_chars(struct view *view, enum line_type type, const char *string, col++; } - if (view->col + col >= view->width + view->yoffset) - view->can_hscroll = TRUE; - return col; } @@ -2122,9 +2118,6 @@ redraw_view_from(struct view *view, int lineno) { assert(0 <= lineno && lineno < view->height); - if (lineno == 0) - view->can_hscroll = FALSE; - for (; lineno < view->height; lineno++) { if (!draw_view_line(view, lineno)) break; @@ -2387,10 +2380,6 @@ scroll_view(struct view *view, enum request request) report(""); return; case REQ_SCROLL_RIGHT: - if (!view->can_hscroll) { - report("Cannot scroll beyond the last column"); - return; - } view->yoffset += apply_step(opt_hscroll, view->width); if (view->yoffset > view->width) view->yoffset = view->width;