summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 93a489f)
raw | patch | inline | side by side (parent: 93a489f)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 15 Feb 2009 16:22:23 +0000 (17:22 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 15 Feb 2009 17:03:58 +0000 (18:03 +0100) |
... to not be limited to the view width and to account for
view->yoffset.
view->yoffset.
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index e374662d1dcc0f3b8eeaaa218b0ecf39ad5e37d3..bf68b9943f0e02cf9754f19467a7ac33cffa2fd1 100644 (file)
--- a/NEWS
+++ b/NEWS
- Blame view: use line number information when loading blame for
specific commit.
- Fix handling of quoted strings in the config file.
+ - Fix horizontal scrolling.
tig-0.14
--------
index 9c6cf010121229e65245f038de74e76c529bcaea..6bf13ec179e03be96e1ca9ad20cec3c987dc79b7 100644 (file)
--- a/tig.c
+++ b/tig.c
draw_text(struct view *view, enum line_type type, const char *string, bool trim)
{
view->col += draw_chars(view, type, string, view->width + view->yoffset - view->col, trim);
- return view->width - view->col <= 0;
+ return view->width + view->yoffset <= view->col;
}
static bool
draw_graphic(struct view *view, enum line_type type, chtype graphic[], size_t size)
{
size_t skip = view->yoffset > view->col ? view->yoffset - view->col : 0;
- int max = view->width - view->col;
+ int max = view->width + view->yoffset - view->col;
int i;
if (max < size)
@@ -1981,13 +1981,13 @@ draw_graphic(struct view *view, enum line_type type, chtype graphic[], size_t si
waddch(view->win, ' ');
view->col++;
- return view->width - view->col <= 0;
+ return view->width + view->yoffset <= view->col;
}
static bool
draw_field(struct view *view, enum line_type type, const char *text, int len, bool trim)
{
- int max = MIN(view->width - view->col, len);
+ int max = MIN(view->width + view->yoffset - view->col, len);
int col;
if (text)
return;
case REQ_SCROLL_RIGHT:
view->yoffset += apply_step(opt_hscroll, view->width);
- if (view->yoffset > view->width)
- view->yoffset = view->width;
redraw_view(view);
report("");
return;