fix somme bugs completion rematch

This commit is contained in:
gwojda 2017-03-27 18:51:27 +02:00
parent ef381ddaae
commit 60200721d7
7 changed files with 11 additions and 12 deletions

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/09 15:50:24 by gwojda #+# #+# */ /* Created: 2017/03/09 15:50:24 by gwojda #+# #+# */
/* Updated: 2017/03/23 19:07:56 by gwojda ### ########.fr */ /* Updated: 2017/03/27 18:50:23 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */ /* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/15 13:27:14 by alao #+# #+# */ /* Created: 2016/10/15 13:27:14 by alao #+# #+# */
/* Updated: 2017/03/27 17:48:25 by gwojda ### ########.fr */ /* Updated: 2017/03/27 18:37:39 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */ /* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/15 12:03:30 by alao #+# #+# */ /* Created: 2017/02/15 12:03:30 by alao #+# #+# */
/* Updated: 2017/03/22 12:25:26 by alao ### ########.fr */ /* Updated: 2017/03/27 18:50:28 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -25,7 +25,6 @@ static int c_refresh_match(t_comp *c, long int keypress)
kpconv[1] = '\0'; kpconv[1] = '\0';
tmp = c->match ? ft_strjoin(c->match, kpconv) : ft_strdup(kpconv); tmp = c->match ? ft_strjoin(c->match, kpconv) : ft_strdup(kpconv);
c->match ? ft_memdel((void *)&c->match) : (0); c->match ? ft_memdel((void *)&c->match) : (0);
c->match = ft_strdup(tmp);
tmp ? ft_memdel((void *)&tmp) : (0); tmp ? ft_memdel((void *)&tmp) : (0);
tmp = ft_strjoin(c->rcmd, kpconv); tmp = ft_strjoin(c->rcmd, kpconv);
c->rcmd ? ft_memdel((void *)&c->rcmd) : (0); c->rcmd ? ft_memdel((void *)&c->rcmd) : (0);
@ -57,12 +56,12 @@ int c_rematch(t_comp *c, long int keypress)
c_term_clear(c); c_term_clear(c);
c_refresh_match(c, keypress); c_refresh_match(c, keypress);
c_clear_lst(c); c_clear_lst(c);
ft_print(keypress, &s->line.input, &s->line.pos);
c_matching(s, c); c_matching(s, c);
if (s->comp && c->lst == NULL) if (s->comp && c->lst == NULL)
c_clear(s); c_clear(s);
else if (s->comp && c->lst == c->lst->next) else if (s->comp && c->lst == c->lst->next)
return (1); return (ft_putchar('\b') + 1);
ft_print(keypress, &s->line.input, &s->line.pos);
return (1); return (1);
} }
else else

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/25 14:09:39 by gwojda #+# #+# */ /* Created: 2017/01/25 14:09:39 by gwojda #+# #+# */
/* Updated: 2017/03/27 17:59:50 by gwojda ### ########.fr */ /* Updated: 2017/03/27 18:07:49 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -3,10 +3,10 @@
/* ::: :::::::: */ /* ::: :::::::: */
/* lexer_backslash.c :+: :+: :+: */ /* lexer_backslash.c :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/03 11:56:49 by jhalford #+# #+# */ /* Created: 2016/12/03 11:56:49 by jhalford #+# #+# */
/* Updated: 2017/03/27 02:16:36 by jhalford ### ########.fr */ /* Updated: 2017/03/27 18:14:22 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 18:36:58 by jhalford #+# #+# */ /* Created: 2016/11/28 18:36:58 by jhalford #+# #+# */
/* Updated: 2017/03/24 16:08:35 by gwojda ### ########.fr */ /* Updated: 2017/03/27 18:15:29 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -30,6 +30,7 @@ int lexer_dquote(t_list **alst, t_lexer *lexer)
lexer->pos++; lexer->pos++;
if (lexer->str[lexer->pos] == 0) if (lexer->str[lexer->pos] == 0)
return (push(&lexer->stack, BACKSLASH) ? 0 : 0); return (push(&lexer->stack, BACKSLASH) ? 0 : 0);
token_append(token, lexer, 1, 0);
} }
else if (lexer->str[lexer->pos] == '`' && (lexer->state = BQUOTE)) else if (lexer->str[lexer->pos] == '`' && (lexer->state = BQUOTE))
return (lexer_lex(alst, lexer)); return (lexer_lex(alst, lexer));

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/15 14:19:48 by gwojda #+# #+# */ /* Created: 2016/12/15 14:19:48 by gwojda #+# #+# */
/* Updated: 2017/03/27 17:38:51 by gwojda ### ########.fr */ /* Updated: 2017/03/27 18:10:21 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -35,7 +35,6 @@ int readline(int has_prompt, char **input)
if (has_prompt) if (has_prompt)
ret = ft_history_parsing(has_prompt, input); ret = ft_history_parsing(has_prompt, input);
ft_strdel(&data_singleton()->line.copy_tmp); ft_strdel(&data_singleton()->line.copy_tmp);
DG("ret = \"%s\"", *input);
if (tcsetattr(0, TCSANOW, ft_save_termios(0)) == -1) if (tcsetattr(0, TCSANOW, ft_save_termios(0)) == -1)
return (-1); return (-1);
return (ret); return (ret);