summaryrefslogtreecommitdiffstats
path: root/src/c_keys.c
diff options
context:
space:
mode:
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)