summaryrefslogtreecommitdiffstats
path: root/src/c_input.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-10-07 14:59:18 +0200
committersalad <fmoenne-@student.le-101.fr>2020-10-07 14:59:18 +0200
commite93ce58b0dec4d6ab4ac03e137d2e37c161eeb9c (patch)
tree9f508e0e515f879eae6476d7998d50005dfafc13 /src/c_input.c
parentC-b + C-f (diff)
download42-minishell-e93ce58b0dec4d6ab4ac03e137d2e37c161eeb9c.tar.gz
42-minishell-e93ce58b0dec4d6ab4ac03e137d2e37c161eeb9c.tar.bz2
42-minishell-e93ce58b0dec4d6ab4ac03e137d2e37c161eeb9c.tar.xz
42-minishell-e93ce58b0dec4d6ab4ac03e137d2e37c161eeb9c.tar.zst
42-minishell-e93ce58b0dec4d6ab4ac03e137d2e37c161eeb9c.zip
qsd
Diffstat (limited to '')
-rw-r--r--src/c_input.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/c_input.c b/src/c_input.c
index 7eb8084..1c14342 100644
--- a/src/c_input.c
+++ b/src/c_input.c
@@ -16,6 +16,7 @@
#include <signal.h>
#include "c_init.h"
+#include "c_keys.h"
#include "c_input.h"
#include "c_utils.h"
#include "m_prompt.h"
@@ -79,24 +80,11 @@ int16_t
uint32_t plen,
t_caps *tcaps)
{
- int32_t pos;
-
- pos = -1;
if (tcaps->cpos >= 1)
{
- 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);
*line = c_delchar(*line, tcaps->cpos);
- tcaps->cpos--;
+ c_key_left(plen, tcaps);
+ tputs(tgetstr("cd", NULL), 1, ft_putchar);
}
return (1);
}