Code

Redraw the whole display after toggling line number
authorJonas Fonseca <fonseca@diku.dk>
Wed, 17 May 2006 21:39:39 +0000 (23:39 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Wed, 17 May 2006 21:39:39 +0000 (23:39 +0200)
tig.c

diff --git a/tig.c b/tig.c
index a4aaa0e1d64c9c0cc612c42449f52faf5c25dfa5..a0f79113736676ca9ee2cffb608e91d6cffa4701 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -798,6 +798,19 @@ update_view_title(struct view *view)
        wrefresh(view->title);
 }
 
+static void
+redraw_display(void)
+{
+       struct view *view;
+       int i;
+
+       foreach_view (view, i) {
+               redraw_view(view);
+               update_view_title(view);
+       }
+}
+
+
 /*
  * Navigation
  */
@@ -1310,8 +1323,7 @@ view_driver(struct view *view, enum request request)
        }
        case REQ_TOGGLE_LINE_NUMBERS:
                opt_line_number = !opt_line_number;
-               redraw_view(view);
-               update_view_title(view);
+               redraw_display();
                break;
 
        case REQ_PROMPT:
@@ -1335,10 +1347,7 @@ view_driver(struct view *view, enum request request)
                resize_display();
                /* Fall-through */
        case REQ_SCREEN_REDRAW:
-               foreach_view (view, i) {
-                       redraw_view(view);
-                       update_view_title(view);
-               }
+               redraw_display();
                break;
 
        case REQ_SCREEN_UPDATE: