diff options
Diffstat (limited to 'src/c_utils.c')
-rw-r--r-- | src/c_utils.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/c_utils.c b/src/c_utils.c index f96d0b3..d5d818a 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -17,16 +17,15 @@ #include <unistd.h> #include "c_init.h" +#include "c_input.h" #include "m_prompt.h" #include "m_loop.h" #include "s_struct.h" /* ** TODO: -** MULTILIGHNE +** MULTILIGHNE (reprint correct) ** FLECHES UP DOWN -** quotes -** unknown chars ** C-c globul pid ** NORME */ @@ -132,23 +131,17 @@ int16_t uint32_t i; uint32_t len; int16_t ret; + uint32_t nlines; i = 0; len = ft_strlen(line); + nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); tputs(tgetstr("cr", NULL), 1, ft_putchar); - if (len >= (tcaps->ws.ws_col - ft_strlen(msh->ps[0]))) + if (nlines > 1) { - if (len % (tcaps->ws.ws_col - ft_strlen(msh->ps[0])) == 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); - } + 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])) { |