From a61be744a8e1beef9f90b57de4c493b034b2ffa1 Mon Sep 17 00:00:00 2001 From: salad Date: Mon, 21 Sep 2020 17:29:35 +0200 Subject: line curs lesgo --- src/c_input.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/c_input.c') diff --git a/src/c_input.c b/src/c_input.c index 37f7b66..37412bd 100644 --- a/src/c_input.c +++ b/src/c_input.c @@ -87,22 +87,21 @@ int16_t int32_t pos; pos = -1; - if (((tcaps->cpos + plen) % (tcaps->ws.ws_col)) == 0 - && tcaps->cpos >= 1) + if (tcaps->cpos >= 1) { - *line = c_delchar(*line, tcaps->cpos); - tputs(tgetstr("up", NULL), 1, ft_putchar); - while(++pos <= (tcaps->ws.ws_col)) - tputs(tgetstr("nd", NULL), 1, ft_putchar); + if (((tcaps->cpos + plen) % (tcaps->ws.ws_col)) == 0) + { + tputs(tgetstr("up", NULL), 1, ft_putchar); + while(++pos <= (tcaps->ws.ws_col)) + tputs(tgetstr("nd", NULL), 1, ft_putchar); + } + else + { + tputs(tgetstr("le", NULL), 1, ft_putchar); + } tputs(tgetstr("dc", NULL), 1, ft_putchar); - tcaps->cpos--; - } - else if (tcaps->cpos >= 1) - { *line = c_delchar(*line, tcaps->cpos); tcaps->cpos--; - tputs(tgetstr("le", NULL), 1, ft_putchar); - tputs(tgetstr("dc", NULL), 1, ft_putchar); } return (1); } -- cgit v1.2.3