mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 04:21:24 +08:00
Export internal el_next_hist() and el_prev_hist()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
f40a2a6a2c
commit
41bbb304b1
@ -65,6 +65,9 @@ extern el_status_t el_del_char(void);
|
|||||||
extern el_status_t el_bind_key(int key, el_keymap_func_t function);
|
extern el_status_t el_bind_key(int key, el_keymap_func_t function);
|
||||||
extern el_status_t el_bind_key_in_metamap(int key, el_keymap_func_t function);
|
extern el_status_t el_bind_key_in_metamap(int key, el_keymap_func_t function);
|
||||||
|
|
||||||
|
extern const char *el_next_hist(void);
|
||||||
|
extern const char *el_prev_hist(void);
|
||||||
|
|
||||||
extern char *rl_complete(char *token, int *match);
|
extern char *rl_complete(char *token, int *match);
|
||||||
extern int rl_list_possib(char *token, char ***av);
|
extern int rl_list_possib(char *token, char ***av);
|
||||||
|
|
||||||
|
@ -551,12 +551,12 @@ static el_status_t toggle_meta_mode(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const char *next_hist(void)
|
const char *el_next_hist(void)
|
||||||
{
|
{
|
||||||
return H.Pos >= H.Size - 1 ? NULL : H.Lines[++H.Pos];
|
return H.Pos >= H.Size - 1 ? NULL : H.Lines[++H.Pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *prev_hist(void)
|
const char *el_prev_hist(void)
|
||||||
{
|
{
|
||||||
return H.Pos == 0 ? NULL : H.Lines[--H.Pos];
|
return H.Pos == 0 ? NULL : H.Lines[--H.Pos];
|
||||||
}
|
}
|
||||||
@ -593,7 +593,7 @@ static el_status_t h_next(void)
|
|||||||
if (el_no_hist)
|
if (el_no_hist)
|
||||||
return CSstay;
|
return CSstay;
|
||||||
|
|
||||||
return do_hist(next_hist);
|
return do_hist(el_next_hist);
|
||||||
}
|
}
|
||||||
|
|
||||||
static el_status_t h_prev(void)
|
static el_status_t h_prev(void)
|
||||||
@ -601,7 +601,7 @@ static el_status_t h_prev(void)
|
|||||||
if (el_no_hist)
|
if (el_no_hist)
|
||||||
return CSstay;
|
return CSstay;
|
||||||
|
|
||||||
return do_hist(prev_hist);
|
return do_hist(el_prev_hist);
|
||||||
}
|
}
|
||||||
|
|
||||||
static el_status_t h_first(void)
|
static el_status_t h_first(void)
|
||||||
@ -701,7 +701,7 @@ static el_status_t h_search(void)
|
|||||||
rl_prompt = "Search: ";
|
rl_prompt = "Search: ";
|
||||||
tty_puts(rl_prompt);
|
tty_puts(rl_prompt);
|
||||||
|
|
||||||
search_move = Repeat == NO_ARG ? prev_hist : next_hist;
|
search_move = Repeat == NO_ARG ? el_prev_hist : el_next_hist;
|
||||||
if (line_handler) {
|
if (line_handler) {
|
||||||
editinput(0);
|
editinput(0);
|
||||||
return CSstay;
|
return CSstay;
|
||||||
|
Loading…
Reference in New Issue
Block a user