summaryrefslogtreecommitdiffstats
path: root/src/c_utils.c
diff options
context:
space:
mode:
authorSalad <water_appreciator@protonmail.com>2020-09-22 16:41:19 +0200
committerSalad <water_appreciator@protonmail.com>2020-09-22 16:41:19 +0200
commit7ce79d44895b81c4822616fc3f0378fb0cdae22c (patch)
tree9d31c49698ec4eae02b78dcb98ab184f90695df9 /src/c_utils.c
parentline curs lesgo (diff)
download42-minishell-7ce79d44895b81c4822616fc3f0378fb0cdae22c.tar.gz
42-minishell-7ce79d44895b81c4822616fc3f0378fb0cdae22c.tar.bz2
42-minishell-7ce79d44895b81c4822616fc3f0378fb0cdae22c.tar.xz
42-minishell-7ce79d44895b81c4822616fc3f0378fb0cdae22c.tar.zst
42-minishell-7ce79d44895b81c4822616fc3f0378fb0cdae22c.zip
HELL YEAH BROTHER
Diffstat (limited to 'src/c_utils.c')
-rw-r--r--src/c_utils.c17
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);
}