From: Jonas Fonseca Date: Fri, 15 Sep 2006 23:40:10 +0000 (+0200) Subject: A simple fix of the bad wrapping bugs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4887d44e87f6ab759e32d30511d78e3f99d0fbcc;p=tig.git A simple fix of the bad wrapping bugs This was surprisingly simple to fix by just turning off scrolling in draw_view_line. From the BUGS file: - If the screen width is very small the main view can draw outside the current view causing bad wrapping. Same goes for title and status windows. - The cursor can wrap-around on the last line and cause the window to scroll. --- diff --git a/BUGS b/BUGS index 79aace6..0783a2e 100644 --- a/BUGS +++ b/BUGS @@ -3,10 +3,3 @@ BUGS Known bugs and problems: - In it's current state tig is pretty much UTF-8 only. - - - If the screen width is very small the main view can draw - outside the current view causing bad wrapping. Same goes - for title and status windows. - - - The cursor can wrap-around on the last line and cause the - window to scroll. diff --git a/tig.c b/tig.c index 1a5ed4a..b0ce18f 100644 --- a/tig.c +++ b/tig.c @@ -1265,6 +1265,7 @@ draw_view_line(struct view *view, unsigned int lineno) { struct line *line; bool selected = (view->offset + lineno == view->lineno); + bool draw_ok; assert(view_is_displayed(view)); @@ -1282,7 +1283,11 @@ draw_view_line(struct view *view, unsigned int lineno) wclrtoeol(view->win); } - return view->ops->draw(view, line, lineno, selected); + scrollok(view->win, FALSE); + draw_ok = view->ops->draw(view, line, lineno, selected); + scrollok(view->win, TRUE); + + return draw_ok; } static void