summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2478dc9)
raw | patch | inline | side by side (parent: 2478dc9)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 19 Jan 2009 15:29:59 +0000 (16:29 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 21 Jan 2009 22:15:17 +0000 (23:15 +0100) |
tig.c | patch | blob | history |
index 6b0aa08dfbd965f278820ba6247ded6f1d3b2e25..a8976b98d864ab25dc9014d99ff8bae5b10ca0d6 100644 (file)
--- a/tig.c
+++ b/tig.c
}
}
+static void
+toggle_view_option(bool *option, const char *help)
+{
+ *option = !*option;
+ redraw_display();
+ report("%sabling %s", *option ? "En" : "Dis", help);
+}
+
/*
* Navigation
*/
break;
case REQ_TOGGLE_LINENO:
- opt_line_number = !opt_line_number;
- redraw_display();
+ toggle_view_option(&opt_line_number, "line numbers");
break;
case REQ_TOGGLE_DATE:
- opt_date = !opt_date;
- redraw_display();
+ toggle_view_option(&opt_date, "date display");
break;
case REQ_TOGGLE_AUTHOR:
- opt_author = !opt_author;
- redraw_display();
+ toggle_view_option(&opt_author, "author display");
break;
case REQ_TOGGLE_REV_GRAPH:
- opt_rev_graph = !opt_rev_graph;
- redraw_display();
+ toggle_view_option(&opt_rev_graph, "revision graph display");
break;
case REQ_TOGGLE_REFS:
- opt_show_refs = !opt_show_refs;
- redraw_display();
+ toggle_view_option(&opt_show_refs, "reference display");
break;
case REQ_SEARCH: