From e6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359 Mon Sep 17 00:00:00 2001 From: Salad Date: Fri, 25 Sep 2020 16:48:16 +0200 Subject: transfert --- src/c_utils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/c_utils.c') diff --git a/src/c_utils.c b/src/c_utils.c index de71ef3..834f192 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -24,10 +24,11 @@ /* ** TODO: -** REPRINT edit +** delchar MOVE +** END MONGARS +** NORME ** FLECHES UP DOWN ** C-c globul pid -** NORME */ uint16_t @@ -132,10 +133,9 @@ int16_t uint32_t len; uint32_t mod; int16_t ret; - uint32_t nlines; i = 0; - nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); + tcaps->nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); len = ft_strlen(line); mod = (tcaps->ws.ws_col); tputs(tgetstr("cr", NULL), 1, ft_putchar); @@ -155,14 +155,14 @@ int16_t tputs(tgetstr("nd", NULL), 1, ft_putchar); i++; } - nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); + tcaps->nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); ret = ft_printf("%s", line); - i = (nlines == (tcaps->lpos)) ? 0 : tcaps->ws.ws_col * (tcaps->lpos - 1); + i = (tcaps->nlines == (tcaps->lpos)) ? 0 : tcaps->ws.ws_col * (tcaps->lpos - 1); if (tcaps->cpos != len) { - if (nlines != tcaps->lpos) + if (tcaps->nlines != tcaps->lpos) { - while (--nlines > tcaps->lpos) + while (--tcaps->nlines > tcaps->lpos) tputs(tgetstr("up", NULL), 1, ft_putchar); tputs(tgetstr("up", NULL), 1, ft_putchar); tputs(tgetstr("cr", NULL), 1, ft_putchar); /* cr, cpos mauvaise col, bonne ligne */ -- cgit v1.2.3