zygo

ncurses gopher client
Log | Files | Refs

commit 686322d5583306b3e25a3a93bcd09d7b71819cc1
parent 23121537946de937981de42537380e10c47f146c
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 27 Jun 2022 19:03:12 +0100

Replace broken line wrapping with indicator for long lines

Diffstat:
M.config.hhvn.h | 2+-
Mconfig.def.h | 2+-
Mzygo.c | 15++++++---------
3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/.config.hhvn.h b/.config.hhvn.h @@ -1,7 +1,7 @@ static char *plumber = "plumb"; static char *yanker = "xclip"; static char *normsep = "│"; -static char *wrapsep = "/"; +static char *toolong = ">"; static int parallelplumb = 1; static int stimeout = 5; static int regexflags = REG_ICASE|REG_EXTENDED; diff --git a/config.def.h b/config.def.h @@ -1,7 +1,7 @@ static char *plumber = "xdg-open"; static char *yanker = "xclip"; static char *normsep = "│"; /* separates link number/info and description */ -static char *wrapsep = "/"; /* same as above, but for wrapped lines */ +static char *toolong = ">"; /* line is too long to fit in terminal */ static int parallelplumb = 0; static int stimeout = 5; static int regexflags = REG_ICASE|REG_EXTENDED; diff --git a/zygo.c b/zygo.c @@ -689,22 +689,19 @@ draw_line(Elem *e, int nwidth) { getyx(stdscr, y, x); for (p = mbdesc; *p; p++) { - addnwstr(p, 1); x++; if (x == COLS) { - if (nwidth) { - printw("%1$ *2$s %3$s ", "", nwidth + 6, wrapsep); - x = 9 + nwidth; - } - y++; + attron(A_REVERSE); + printw("%s", toolong); + goto end; } - if (y == LINES - 1) - break; + addnwstr(p, 1); } + printw("\n"); +end: free(mbdesc); attroff(A_REVERSE); - printw("\n"); return y + 1; }