Code

Add line-graphics option to disable graphics characters for line drawing
authorDominik Vogt <dvogt@ffm.tc.iot.dtag.de>
Mon, 7 Apr 2008 20:15:03 +0000 (22:15 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Sat, 19 Apr 2008 13:16:31 +0000 (15:16 +0200)
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
tig.c
tigrc.5.txt

diff --git a/tig.c b/tig.c
index 9d0dca1a07d81694a5732f92d75f9b68ea41fd14..cdf3cd760112faaf0a803f5448657f5c7b3bf4ab 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -438,6 +438,7 @@ static const char usage[] =
 static bool opt_date                   = TRUE;
 static bool opt_author                 = TRUE;
 static bool opt_line_number            = FALSE;
+static bool opt_line_graphics          = TRUE;
 static bool opt_rev_graph              = FALSE;
 static bool opt_show_refs              = TRUE;
 static int opt_num_interval            = NUMBER_INTERVAL;
@@ -1127,6 +1128,11 @@ option_set_command(int argc, char *argv[])
                return OK;
        }
 
+       if (!strcmp(argv[0], "line-graphics")) {
+               opt_line_graphics = parse_bool(argv[2]);
+               return OK;
+       }
+
        if (!strcmp(argv[0], "line-number-interval")) {
                opt_num_interval = atoi(argv[2]);
                return OK;
@@ -1515,7 +1521,7 @@ draw_lineno(struct view *view, unsigned int lineno, int max, bool selected)
        if (col < max) {
                if (!selected)
                        wattrset(view->win, A_NORMAL);
-               waddch(view->win, ACS_VLINE);
+               waddch(view->win, opt_line_graphics ? ACS_VLINE : '|');
                col++;
        }
        if (col < max) {
index bccb30474c3797509a51d463ade00277cdc15501..5e204f33c147c774a591d273734e8ef884e3958e 100644 (file)
@@ -47,6 +47,7 @@ set show-date = yes           # Show commit date?
 set show-rev-graph = yes       # Show revision graph?
 set show-refs = yes            # Show references?
 set show-line-numbers = no     # Show line numbers?
+set line-graphics = no         # Disable graphics characters
 set line-number-interval = 5   # Interval between line numbers
 set tab-size = 8               # Number of spaces per tab
 set encoding = "UTF-8"         # Commit encoding
@@ -81,6 +82,10 @@ The following variables can be set:
        (branches, tags, and remotes) in the main view on start-up. Can all be
        toggled.
 
+'line-graphics' (bool)::
+
+       Whether to use graphic characters for line drawing.
+
 'line-number-interval' (int)::
 
        Interval between line numbers. Note, you have to toggle on line