diff options
Diffstat (limited to 'src/c_utils.c')
-rw-r--r-- | src/c_utils.c | 17 |
1 files changed, 17 insertions, 0 deletions
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); } |