This commit is contained in:
gwojda 2017-03-29 17:46:08 +02:00
parent 40e9d83db1
commit b377119713
2 changed files with 15 additions and 2 deletions

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/23 10:35:44 by gwojda #+# #+# */ /* Created: 2017/01/23 10:35:44 by gwojda #+# #+# */
/* Updated: 2017/03/27 18:00:07 by gwojda ### ########.fr */ /* Updated: 2017/03/29 17:41:14 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -135,6 +135,7 @@ int ft_get_size_prev(char *str, size_t pos);
void sigwinch_resize(int sig); void sigwinch_resize(int sig);
size_t ft_hist_len(void); size_t ft_hist_len(void);
int hist_is_delim(char c); int hist_is_delim(char c);
int ft_nb_last_line(char *str, size_t pos);
int underline_right(char **str, size_t *pos, size_t pos_ref); int underline_right(char **str, size_t *pos, size_t pos_ref);
int underline_left(char **str, size_t *pos, size_t pos_ref); int underline_left(char **str, size_t *pos, size_t pos_ref);

View file

@ -6,12 +6,23 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/19 16:43:58 by gwojda #+# #+# */ /* Created: 2016/12/19 16:43:58 by gwojda #+# #+# */
/* Updated: 2017/03/17 11:51:32 by gwojda ### ########.fr */ /* Updated: 2017/03/29 17:45:36 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "minishell.h" #include "minishell.h"
static void check_end_right(char *str, size_t pos)
{
if (!str)
return ;
if (ft_nb_last_line(str, pos) == 0)
{
ft_putchar(str[pos]);
ft_puttermcaps("le");
}
}
int ft_move_right(char **str, size_t *pos) int ft_move_right(char **str, size_t *pos)
{ {
size_t tmp; size_t tmp;
@ -36,6 +47,7 @@ int ft_move_right(char **str, size_t *pos)
{ {
ft_putchar((*str)[*pos]); ft_putchar((*str)[*pos]);
++(*pos); ++(*pos);
check_end_right(*str, *pos);
} }
return (0); return (0);
} }