summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/c_init.c5
-rw-r--r--src/c_utils.c22
2 files changed, 18 insertions, 9 deletions
diff --git a/src/c_init.c b/src/c_init.c
index bb6383d..ac0c579 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -77,10 +77,7 @@ int16_t
}
if (ft_isprint(buf[0]))
{
- if (tcaps->cpos == ft_strlen(line))
- line = ft_strjoin(line, buf);
- else
- line = c_insert_char(line, buf[0], tcaps);
+ line = c_insert_char(line, buf[0], tcaps);
c_redraw_line(line, tcaps, msh);
tcaps->cpos++;
}
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);