From 7ce79d44895b81c4822616fc3f0378fb0cdae22c Mon Sep 17 00:00:00 2001 From: Salad Date: Tue, 22 Sep 2020 16:41:19 +0200 Subject: HELL YEAH BROTHER --- src/c_utils.c | 17 +++++++++++++++++ src/lpos | Bin 0 -> 2758 bytes 2 files changed, 17 insertions(+) create mode 100644 src/lpos (limited to 'src') diff --git a/src/c_utils.c b/src/c_utils.c index 372f66d..43ed94e 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -155,9 +155,26 @@ int16_t tputs(tgetstr("nd", NULL), 1, ft_putchar); i++; } + nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); ret = ft_printf("%s", line); + i = 0; if (tcaps->cpos != len) + { + if (nlines != tcaps->lpos) + { + ft_printf("%d", tcaps->cpos); + while (--nlines > tcaps->lpos) + tputs(tgetstr("up", NULL), 1, ft_putchar); + tputs(tgetstr("cr", NULL), 1, ft_putchar); /* cr, cpos mauvaise col, bonne ligne */ + tputs(tgetstr("up", NULL), 1, ft_putchar); + while (i < (tcaps->cpos)) + { + tputs(tgetstr("nd", NULL), 1, ft_putchar); /* cr, cpos mauvaise col, bonne ligne */ + i++; + } + } while (--len > tcaps->cpos) tputs(tgetstr("le", NULL), 1, ft_putchar); + } return (ret); } diff --git a/src/lpos b/src/lpos new file mode 100644 index 0000000..fa32915 Binary files /dev/null and b/src/lpos differ -- cgit v1.2.3