diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-09-21 15:00:11 +0200 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-09-21 15:00:11 +0200 |
commit | 44feb9e93f6d5f8d074b237b6b8b335c4dc3b235 (patch) | |
tree | 71b456afdcf4d1a1bf9e7759f198f6e3200dc64b | |
parent | FINALLY (diff) | |
download | 42-minishell-44feb9e93f6d5f8d074b237b6b8b335c4dc3b235.tar.gz 42-minishell-44feb9e93f6d5f8d074b237b6b8b335c4dc3b235.tar.bz2 42-minishell-44feb9e93f6d5f8d074b237b6b8b335c4dc3b235.tar.xz 42-minishell-44feb9e93f6d5f8d074b237b6b8b335c4dc3b235.tar.zst 42-minishell-44feb9e93f6d5f8d074b237b6b8b335c4dc3b235.zip |
lets fucking go
-rw-r--r-- | src/c_keys.c | 4 | ||||
-rw-r--r-- | src/c_utils.c | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/c_keys.c b/src/c_keys.c index f9141d7..fc8962e 100644 --- a/src/c_keys.c +++ b/src/c_keys.c @@ -63,7 +63,7 @@ int16_t uint32_t plen, t_caps *tcaps) { - if (((tcaps->cpos + 1) % (tcaps->ws.ws_col - plen)) == 0 && tcaps->cpos < len) + if (((tcaps->cpos + plen + 1) % (tcaps->ws.ws_col)) == 0 && tcaps->cpos < len) { tputs(tgetstr("do", NULL), 1, ft_putchar); tputs(tgetstr("cr", NULL), 1, ft_putchar); @@ -86,7 +86,7 @@ int16_t (void)len; pos = -1; - if (((tcaps->cpos) % (tcaps->ws.ws_col - plen)) == 0 && tcaps->cpos >= 1) + if (((tcaps->cpos + plen) % (tcaps->ws.ws_col )) == 0 && tcaps->cpos >= 1) { tputs(tgetstr("up", NULL), 1, ft_putchar); while(++pos <= (tcaps->ws.ws_col)) diff --git a/src/c_utils.c b/src/c_utils.c index 2cff50f..96a9c2b 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -138,12 +138,9 @@ int16_t nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps); len = ft_strlen(line); mod = (tcaps->ws.ws_col); - /* mod -= (nlines > 1) ? 0 : ; */ - /* ft_printf("[%u]", mod); */ tputs(tgetstr("cr", NULL), 1, ft_putchar); if (((len + ft_strlen(msh->ps[0])) % mod) == 0) { - ft_printf("qwe"); tputs(tgetstr("sf", NULL), 1, ft_putchar); return (1); } |