static void do_show_hist (WInput * in) { size_t len; char *r; len = get_history_length (in->history); r = history_show (&in->history, &in->widget); if (r != NULL) { input_assign_text (in, r); g_free (r); } /* Has history cleaned up or not? */ if (len != get_history_length (in->history)) in->history_changed = TRUE; }
static void do_show_hist (WInput * in) { size_t len; char *r; len = get_history_length (in->history.list); r = history_show (&in->history.list, WIDGET (in), g_list_position (in->history.list, in->history.list)); if (r != NULL) { input_assign_text (in, r); g_free (r); } /* Has history cleaned up or not? */ if (len != get_history_length (in->history.list)) in->history.changed = TRUE; }
void press_down_key(void) { t_history *history; history = g_shell.history; if (g_shell.history_index < get_history_length(history)) { if (g_shell.backslash_index != -1) replace_shell_backslash_line(get_history_i(g_shell.history_index)); else replace_shell_line(get_history_i(g_shell.history_index)); g_shell.history_index++; } else if (g_shell.history_index == get_history_length(history)) { g_shell.history_index = get_history_length(history) + 1; if (g_shell.backslash_index == -1) replace_shell_line(g_shell.shell_line_original); else replace_shell_backslash_line(g_shell.shell_line_original); } }