summaryrefslogtreecommitdiffstats
path: root/src/c_keys.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-09-29 14:15:27 +0200
committersalad <fmoenne-@student.le-101.fr>2020-09-29 14:15:27 +0200
commit8625b18bc68a149014edd059cdeb831716fc3d86 (patch)
treeb30eb584e3cb888caa1f17f3bfa9583233617d8d /src/c_keys.c
parentTHI S IS THE END (diff)
download42-minishell-8625b18bc68a149014edd059cdeb831716fc3d86.tar.gz
42-minishell-8625b18bc68a149014edd059cdeb831716fc3d86.tar.bz2
42-minishell-8625b18bc68a149014edd059cdeb831716fc3d86.tar.xz
42-minishell-8625b18bc68a149014edd059cdeb831716fc3d86.tar.zst
42-minishell-8625b18bc68a149014edd059cdeb831716fc3d86.zip
pouche yeah yeay yeah
Diffstat (limited to 'src/c_keys.c')
-rw-r--r--src/c_keys.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/c_keys.c b/src/c_keys.c
index d37a76e..8232521 100644
--- a/src/c_keys.c
+++ b/src/c_keys.c
@@ -35,11 +35,11 @@ int16_t
int16_t j;
i = tcaps->cpos;
- j = (tcaps->lpos - 1);
+ j = tcaps->lpos;
if (tcaps->cpos > 0 && j > 0)
{
i = 0;
- while (--j >= 0)
+ while (--j > 0)
tputs(tgetstr("up", NULL), 1, ft_putchar);
tputs(tgetstr("cr", NULL), 1, ft_putchar);
while ((uint32_t)++i <= 13)
@@ -60,24 +60,20 @@ int16_t
uint16_t i;
uint16_t j;
- /* i = (tcaps->nlines == (tcaps->lpos)) ? 0 : tcaps->ws.ws_col * (tcaps->lpos); */
- i = 0;
- j = (tcaps->lpos);
+ i = tcaps->cpos;
+ j = tcaps->lpos;
if (tcaps->cpos < size && j < tcaps->nlines)
{
+ i = 0;
while (j < (tcaps->nlines))
{
tputs(tgetstr("do", NULL), 1, ft_putchar);
- j++;
i += tcaps->ws.ws_col;
+ j++;
}
tputs(tgetstr("cr", NULL), 1, ft_putchar);
- /* ft_printf("[%d][%d]", i, size); */
- while (i < (size + 13))
- {
+ while (i++ < (size + 13))
tputs(tgetstr("nd", NULL), 1, ft_putchar);
- i++;
- }
}
else
while (i++ < size)