summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_init.c3
-rw-r--r--src/c_input.c18
-rw-r--r--src/c_utils.c1
3 files changed, 6 insertions, 16 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 745fad9..9196d51 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -102,7 +102,10 @@ static char
tcaps->cpos++;
}
else if ((*((unsigned int *)buf)) == DEL_K)
+ {
c_back_slash(&line, ft_strlen(msh->ps[tcaps->psx]), tcaps);
+ c_redraw_line(line, tcaps, msh);
+ }
else
c_read_cap(buf, line, tcaps, msh);
if (buf[0] == '\n')
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);
}
diff --git a/src/c_utils.c b/src/c_utils.c
index 23d5007..b18b949 100644
--- a/src/c_utils.c
+++ b/src/c_utils.c
@@ -112,7 +112,6 @@ static int16_t
uint32_t i;
uint32_t j;
- /* ft_printf("%u%u", tcaps->nlines, tcaps->lpos); */
i = (tcaps->nlines == tcaps->lpos) ? 0 : tcaps->ws.ws_col * (tcaps->lpos - 1);
j = tcaps->nlines;
if (tcaps->nlines != tcaps->lpos)