From 695bfa914d789345fa524395f59a7c6a96122eeb Mon Sep 17 00:00:00 2001 From: salad Date: Thu, 17 Sep 2020 15:58:05 +0200 Subject: multiligne prototype et plus de leaks --- src/c_utils.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/c_utils.c') diff --git a/src/c_utils.c b/src/c_utils.c index b50280d..35c95ef 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -24,13 +24,11 @@ /* ** TODO: -** leaks on line +** MULTILIGHNE ** quotes ** C-c ** NORME -** MULTILIGHNE -** term(0) on exit DONE -** cursor on char insert DONE +** leaks on line ??? GONE ? */ int16_t @@ -171,8 +169,22 @@ int16_t int16_t ret; i = 0; - tputs(tgetstr("cr", NULL), 1, ft_putchar); len = ft_strlen(line); + tputs(tgetstr("cr", NULL), 1, ft_putchar); + if (len >= (tcaps->ws.ws_col - ft_strlen(msh->ps[0]))) + { + if (len == (tcaps->ws.ws_col - ft_strlen(msh->ps[0]))) + { + tputs(tgetstr("sf", NULL), 1, ft_putchar); + return (1); + } + else + { + tputs(tgetstr("sf", NULL), 1, ft_putchar); + tputs(tgetstr("up", NULL), 1, ft_putchar); + tputs(tgetstr("up", NULL), 1, ft_putchar); + } + } while (i < ft_strlen(msh->ps[0])) { tputs(tgetstr("nd", NULL), 1, ft_putchar); -- cgit v1.2.3