summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2016-01-08 15:42:59 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2016-01-08 15:42:59 +0100
commitad842ea8a60f107d68df4298a8914e66edf95c3b (patch)
treebb626f02e75538edea4c9c698b0c322aca26e2c7 /src/fe-text
parent4659cea65a663b11f3cc16e1d03c9955a4135238 (diff)
downloadirssi-ad842ea8a60f107d68df4298a8914e66edf95c3b.zip
reorder history add and fixes
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/gui-readline.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
index fcf152e8..5acfaf60 100644
--- a/src/fe-text/gui-readline.c
+++ b/src/fe-text/gui-readline.c
@@ -456,22 +456,21 @@ static void key_send_line(void)
add_history = *str != '\0';
history = command_history_current(active_win);
+ if (redir != NULL && redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
+ add_history = 0;
+
+ if (add_history && history != NULL) {
+ command_history_add(history, str);
+ }
+
if (redir == NULL) {
signal_emit("send command", 3, str,
active_win->active_server,
active_win->active);
} else {
- if (redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
- add_history = 0;
handle_entry_redirect(str);
}
- if (add_history) {
- history = command_history_find(history);
- if (history != NULL)
- command_history_add(history, str);
- }
-
if (active_entry != NULL)
gui_entry_set_text(active_entry, "");
command_history_clear_pos(active_win);