summaryrefslogtreecommitdiffstats
path: root/src/c_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_utils.c')
-rw-r--r--src/c_utils.c22
1 files changed, 17 insertions, 5 deletions
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);