Code

tig-0.14.1
[tig.git] / tig.c
diff --git a/tig.c b/tig.c
index 148b6b60b1147c130ea7778745011f9cd4646daa..180661a4fcfbc94067a795898df1a6fc6a6e0330 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1905,7 +1905,7 @@ draw_space(struct view *view, enum line_type type, int max, int spaces)
        while (spaces > 0) {
                int len = MIN(spaces, sizeof(space) - 1);
 
-               col += draw_chars(view, type, space, spaces, FALSE);
+               col += draw_chars(view, type, space, len, FALSE);
                spaces -= len;
        }
 
@@ -2032,9 +2032,7 @@ draw_lineno(struct view *view, unsigned int lineno)
        if (lineno == 1 || (lineno % opt_num_interval) == 0) {
                static char fmt[] = "%1ld";
 
-               if (view->digits <= 9)
-                       fmt[1] = '0' + digits3;
-
+               fmt[1] = '0' + (view->digits <= 9 ? digits3 : 1);
                if (string_format(number, fmt, lineno))
                        text = number;
        }
@@ -3103,10 +3101,8 @@ view_driver(struct view *view, enum request request)
 {
        int i;
 
-       if (request == REQ_NONE) {
-               doupdate();
+       if (request == REQ_NONE)
                return TRUE;
-       }
 
        if (request > REQ_NONE) {
                open_run_request(request);
@@ -5122,6 +5118,7 @@ status_update_files(struct view *view, struct line *line)
        struct line *pos = view->line + view->lines;
        int files = 0;
        int file, done;
+       int cursor_y, cursor_x;
 
        if (!status_update_prepare(&io, line->type))
                return FALSE;
@@ -5130,6 +5127,7 @@ status_update_files(struct view *view, struct line *line)
                files++;
 
        string_copy(buf, view->ref);
+       getsyx(cursor_y, cursor_x);
        for (file = 0, done = 5; result && file < files; line++, file++) {
                int almost_done = file * 100 / files;
 
@@ -5138,6 +5136,7 @@ status_update_files(struct view *view, struct line *line)
                        string_format(view->ref, "updating file %u of %u (%d%% done)",
                                      file, files, done);
                        update_view_title(view);
+                       setsyx(cursor_y, cursor_x);
                        doupdate();
                }
                result = status_update_write(&io, line->data, line->type);