diff options
Diffstat (limited to '')
-rw-r--r-- | src/c_keys_next.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/c_keys_next.c b/src/c_keys_next.c index 629d9f8..ec063d3 100644 --- a/src/c_keys_next.c +++ b/src/c_keys_next.c @@ -17,30 +17,15 @@ #include "c_init.h" #include "c_keys.h" #include "d_define.h" -#include "s_struct.h" -short c_key_up(char *line[], t_caps *tcaps, t_msh *msh) +void c_key_up_down(char *line[], t_caps *tcaps, char *ptr) { - char tmp[ARG_MAX]; - static char *ptr; - static t_bool set = TRUE; + char tmp[ARG_MAX]; - if (set == TRUE) - { - ptr = msh->curr_hist_ptr + ft_strlen(msh->curr_hist_ptr); - set = FALSE; - } - ptr -= 2; - while (ptr - msh->curr_hist_ptr != 0 && *ptr != '\n') - { - ptr--; - } - ptr += 1; c_home_key(tcaps->plen, tcaps); ft_substr_s(tmp, ptr, 0, ft_strclen(ptr, '\n')); ft_memdel((void*)&(*line)); tputs(tgetstr("ce", NULL), 1, ft_putchar); *line = ft_strdup(tmp); tcaps->cpos = ft_strlen(*line); - return (1); } |