diff --git a/README.md b/README.md index 8d26d32..0ac8954 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ Build yours by copying `irc9rc-example` to `irc9rc` next to the binary (or to [irc9] irc.example / #general /----------------------\---------------------------------------- |* irc.example | Topic: General discussion -| | --------------------------------------- +| |---------------------------------------- | |-#general | | |-#help(3) | | \-alice | [10:21] hello there diff --git a/irc9.c b/irc9.c index 1646e44..39ec0d6 100644 --- a/irc9.c +++ b/irc9.c @@ -2553,6 +2553,15 @@ static void draw_title(void) fputs("\033[0m", stdout); } +static void draw_pane_divider(int row) +{ + int left = lines > 5 && treew >= 2 ? treew : 0; + terminal_move(row, left); + terminal_accent(); + terminal_repeat('-', cols - left); + fputs("\033[0m", stdout); +} + /* Include the topic divider when calculating the chat pane height. */ static int layout_topic(int draw) { @@ -2576,12 +2585,7 @@ static int layout_topic(int draw) if (draw && row < height) draw_irc_text(chat_top + row, left, text, width); free(text); } - if (draw && divider) { - terminal_move(chat_top + height, left); - terminal_accent(); - terminal_repeat('-', width); - fputs("\033[0m", stdout); - } + if (draw && divider) draw_pane_divider(chat_top + height); return height + divider; } @@ -2622,15 +2626,6 @@ static void draw_main(void) } } -static void draw_pane_divider(int row) -{ - int left = lines > 5 && treew >= 2 ? treew : 0; - terminal_move(row, left); - terminal_accent(); - terminal_repeat('-', cols - left); - fputs("\033[0m", stdout); -} - static void draw_status(void) { status_minute = time(NULL) / 60;