From 4887d44e87f6ab759e32d30511d78e3f99d0fbcc Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 16 Sep 2006 01:40:10 +0200 Subject: [PATCH] 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. --- BUGS | 7 ------- tig.c | 7 ++++++- 2 files changed, 6 insertions(+), 8 deletions(-) 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 -- 2.32.0.93.g670b81a890