diff --git a/src/display.c b/src/display.c index c7e251682..fd522d68f 100644 --- a/src/display.c +++ b/src/display.c @@ -187,11 +187,24 @@ static void redraw_display_separator(bool clear) { if (display_sep) { - chtype separator = opt_line_graphics ? ACS_VLINE : '|'; + int lineno = 0; if (clear) wclear(display_sep); - wbkgd(display_sep, separator + get_line_attr(NULL, LINE_TITLE_BLUR)); + wbkgdset(display_sep, get_line_attr(NULL, LINE_TITLE_BLUR)); + + switch (opt_line_graphics) { + case GRAPHIC_ASCII: + while (mvwaddch(display_sep, lineno++, 0, '|') == OK); + break; + case GRAPHIC_DEFAULT: + while (mvwaddch(display_sep, lineno++, 0, ACS_VLINE) == OK); + break; + case GRAPHIC_UTF_8: + while (mvwaddstr(display_sep, lineno++, 0, "│") == OK); + break; + } + wnoutrefresh(display_sep); } } diff --git a/src/draw.c b/src/draw.c index 684184f79..afe0d1545 100644 --- a/src/draw.c +++ b/src/draw.c @@ -314,7 +314,7 @@ draw_lineno_custom(struct view *view, struct view_column *column, unsigned int l unsigned long digits3 = MIN(9,MAX(3,column->width)); int max = MIN(VIEW_MAX_LEN(view), digits3); char *text = NULL; - chtype separator = opt_line_graphics ? ACS_VLINE : '|'; + chtype separator = ACS_VLINE; struct line_number_options *opts = &column->opt.line_number; int interval = opts->interval > 0 ? opts->interval : 5; @@ -332,7 +332,17 @@ draw_lineno_custom(struct view *view, struct view_column *column, unsigned int l draw_chars(view, LINE_LINE_NUMBER, text, -1, max, true); else draw_space(view, LINE_LINE_NUMBER, max, digits3); - return draw_graphic(view, LINE_DEFAULT, &separator, 1, true); + + switch (opt_line_graphics) { + case GRAPHIC_ASCII: + return draw_chars(view, LINE_DEFAULT, "| ", -1, 2, false); + case GRAPHIC_DEFAULT: + return draw_graphic(view, LINE_DEFAULT, &separator, 1, true); + case GRAPHIC_UTF_8: + return draw_chars(view, LINE_DEFAULT, "│ ", -1, 2, false); + } + + return false; } bool diff --git a/test/main/vertical-lines-test b/test/main/vertical-lines-test new file mode 100755 index 000000000..1582727a1 --- /dev/null +++ b/test/main/vertical-lines-test @@ -0,0 +1,90 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +export WIDTH=40 +export LINES=18 + +tigrc <