summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer-commands.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2017-09-08 15:19:40 +0200
committerailin-nemui <ailin-nemui@users.noreply.github.com>2017-09-21 14:20:31 +0200
commit8dfeca57ede1e726de07522a87203ce13676882d (patch)
tree47d7f3e78826c57f8ab9ec86a996e0257647c8f1 /src/fe-text/textbuffer-commands.c
parentbe70fa5eb750ed337a55463c68d5a51b47d1efcd (diff)
downloadirssi-8dfeca57ede1e726de07522a87203ce13676882d.zip
hidden lines
Diffstat (limited to 'src/fe-text/textbuffer-commands.c')
-rw-r--r--src/fe-text/textbuffer-commands.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/fe-text/textbuffer-commands.c b/src/fe-text/textbuffer-commands.c
index 648862e7..97d897f3 100644
--- a/src/fe-text/textbuffer-commands.c
+++ b/src/fe-text/textbuffer-commands.c
@@ -89,6 +89,25 @@ static void cmd_window_scroll(const char *data)
gui->scroll : settings_get_bool("scroll"));
}
+/* SYNTAX: WINDOW HIDELEVEL [<level>] */
+static void cmd_window_hidelevel(const char *data)
+{
+ GUI_WINDOW_REC *gui;
+ char *level;
+
+ g_return_if_fail(data != NULL);
+
+ gui = WINDOW_GUI(active_win);
+ textbuffer_view_set_hidden_level(gui->view,
+ combine_level(gui->view->hidden_level, data));
+ textbuffer_view_redraw(gui->view);
+ level = gui->view->hidden_level == 0 ? g_strdup("NONE") :
+ bits2level(gui->view->hidden_level);
+ printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
+ TXT_WINDOW_HIDELEVEL, level);
+ g_free(level);
+}
+
static void cmd_scrollback(const char *data, SERVER_REC *server,
WI_ITEM_REC *item)
{
@@ -358,6 +377,7 @@ void textbuffer_commands_init(void)
{
command_bind("clear", NULL, (SIGNAL_FUNC) cmd_clear);
command_bind("window scroll", NULL, (SIGNAL_FUNC) cmd_window_scroll);
+ command_bind("window hidelevel", NULL, (SIGNAL_FUNC) cmd_window_hidelevel);
command_bind("scrollback", NULL, (SIGNAL_FUNC) cmd_scrollback);
command_bind("scrollback clear", NULL, (SIGNAL_FUNC) cmd_scrollback_clear);
command_bind("scrollback levelclear", NULL, (SIGNAL_FUNC) cmd_scrollback_levelclear);
@@ -377,6 +397,7 @@ void textbuffer_commands_deinit(void)
{
command_unbind("clear", (SIGNAL_FUNC) cmd_clear);
command_unbind("window scroll", (SIGNAL_FUNC) cmd_window_scroll);
+ command_unbind("window hidelevel", (SIGNAL_FUNC) cmd_window_hidelevel);
command_unbind("scrollback", (SIGNAL_FUNC) cmd_scrollback);
command_unbind("scrollback clear", (SIGNAL_FUNC) cmd_scrollback_clear);
command_unbind("scrollback levelclear", (SIGNAL_FUNC) cmd_scrollback_levelclear);