diff options
author | Simmo Saan <simmo.saan@gmail.com> | 2019-05-02 21:16:57 +0300 |
---|---|---|
committer | Simmo Saan <simmo.saan@gmail.com> | 2019-05-02 21:16:57 +0300 |
commit | c7b242ffd9beaf3cdbdf6a8927e660fe65969b49 (patch) | |
tree | 84eda1cd57d44e765618262cb30f9ee1d1088e49 | |
parent | bf1462d7a14aa47b2b36b6569cd0472cee5002ad (diff) | |
download | weechat-c7b242ffd9beaf3cdbdf6a8927e660fe65969b49.zip |
gui: readd color buffer table zero padding and dashes (issue #1343)
-rw-r--r-- | src/gui/curses/gui-curses-color.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index f54a0bf35..d61636fe9 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -834,7 +834,9 @@ gui_color_buffer_display () columns = 16; max_color = (gui_color_use_term_colors) ? gui_color_term_colors - 1 : gui_color_pairs_used; - lines = (max_color + columns) / columns; + /* round up to nearest multiple of columns */ + max_color = (max_color / columns) * columns + columns - 1; + lines = max_color / columns + 1; for (line = 0; line < lines; line++) { str_line[0] = '\0'; @@ -852,7 +854,7 @@ gui_color_buffer_display () || (color <= gui_color_pairs_used)) { snprintf (str_color, sizeof (str_color), - (color <= 999) ? "%c%c%05d %3d " : "%c%c%05d%5d", + (color <= 999) ? "%c%c%05d %03d " : "%c%c%05d%5d", GUI_COLOR_COLOR_CHAR, GUI_COLOR_EXTENDED_CHAR, color, |