summaryrefslogtreecommitdiff
path: root/src/fe-common/core/window-commands.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2015-12-15 11:12:09 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2015-12-15 11:12:09 +0100
commit45f8d5bd6a2f98a4d211df8c51c602a84f6777e4 (patch)
treefef69221f00ccf9abbba078d7e8fd4912fa5d499 /src/fe-common/core/window-commands.c
parent311b01e72a81a6fdef1c477d3255b76e545d49f1 (diff)
parente4e040929b247b2432190b84b6edca997dacd600 (diff)
downloadirssi-45f8d5bd6a2f98a4d211df8c51c602a84f6777e4.zip
Merge pull request #385 from ailin-nemui/master
option to clear the history
Diffstat (limited to 'src/fe-common/core/window-commands.c')
-rw-r--r--src/fe-common/core/window-commands.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c
index c6ab68c0..e5005144 100644
--- a/src/fe-common/core/window-commands.c
+++ b/src/fe-common/core/window-commands.c
@@ -33,6 +33,7 @@
#include "window-items.h"
#include "windows-layout.h"
#include "printtext.h"
+#include "command-history.h"
static void window_print_binds(WINDOW_REC *win)
{
@@ -615,10 +616,25 @@ static void cmd_window_name(const char *data)
}
}
-/* SYNTAX: WINDOW HISTORY <name> */
+/* SYNTAX: WINDOW HISTORY [-clear] <name> */
void cmd_window_history(const char *data)
{
- window_set_history(active_win, data);
+ GHashTable *optlist;
+ char *name;
+ void *free_arg;
+
+ if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
+ "window history", &optlist, &name))
+ return;
+
+ if (g_hash_table_lookup(optlist, "clear") != NULL) {
+ signal_continue(1, data);
+ window_clear_history(active_win, name);
+ } else {
+ window_set_history(active_win, name);
+ }
+
+ cmd_params_free(free_arg);
}
/* we're moving the first window to last - move the first contiguous block
@@ -883,6 +899,7 @@ void window_commands_init(void)
command_set_options("window number", "sticky");
command_set_options("window server", "sticky unsticky");
command_set_options("window theme", "delete");
+ command_set_options("window history", "clear");
}
void window_commands_deinit(void)