summaryrefslogtreecommitdiffstats
path: root/src/c_init.c
diff options
context:
space:
mode:
authorjoe <rbousset@42lyon.fr>2020-12-01 16:12:02 +0100
committerjoe <rbousset@42lyon.fr>2020-12-01 16:12:02 +0100
commit214eae8a55bde34ca412084bebdb378a696152cc (patch)
tree70404f68b1b86035fe4835d8cf2da61dcefc5eba /src/c_init.c
parentNot quite done (diff)
download42-minishell-214eae8a55bde34ca412084bebdb378a696152cc.tar.gz
42-minishell-214eae8a55bde34ca412084bebdb378a696152cc.tar.bz2
42-minishell-214eae8a55bde34ca412084bebdb378a696152cc.tar.xz
42-minishell-214eae8a55bde34ca412084bebdb378a696152cc.tar.zst
42-minishell-214eae8a55bde34ca412084bebdb378a696152cc.zip
Bav
Diffstat (limited to '')
-rw-r--r--src/c_init.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 1ab6743..965af3f 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -89,9 +89,6 @@ static short
return (c_end_key(ft_strlen(line), tcaps->plen, tcaps));
else if ((*((unsigned int *)buf)) == CTRL_L)
return (c_ctrl_l(line, tcaps, msh));
- else if (((*((unsigned int *)buf)) == UP_K) ||
- ((*((unsigned int *)buf)) == CTRL_P))
- return (c_key_up(tcaps, msh));
else if ((*((unsigned int *)buf)) == CTRL_D &&
line[0] == '\0')
{
@@ -120,6 +117,12 @@ static char
return (NULL);
if (ft_isprint(buf[0]))
c_add_char(&line, buf, tcaps, msh);
+ else if (((*((unsigned int *)buf)) == UP_K) ||
+ ((*((unsigned int *)buf)) == CTRL_P))
+ {
+ c_key_up(&line, tcaps, msh);
+ c_redraw_line(line, tcaps, msh);
+ }
else if ((*((unsigned int *)buf)) == DEL_K)
{
c_back_slash(&line, tcaps->plen, tcaps);