diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-11 11:40:23 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-11 11:40:23 +0200 |
commit | 2b1dec16795f9782a0c0e7644b19ef17d4feed98 (patch) | |
tree | a32371a110aeca64be7d1a0dbaa481fce683034f /src | |
parent | 7871b62ef881370e3126b9459441711cfdd7b05b (diff) | |
download | weechat-2b1dec16795f9782a0c0e7644b19ef17d4feed98.zip |
New input action "set_unread_current_buffer" to set unread marker for current buffer only (task #7286)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-command.c | 2 | ||||
-rw-r--r-- | src/gui/gui-input.c | 15 | ||||
-rw-r--r-- | src/gui/gui-input.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 6a258fdd3..3ca29a587 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1201,6 +1201,8 @@ command_input (void *data, struct t_gui_buffer *buffer, gui_input_scroll_unread (); else if (string_strcasecmp (argv[1], "set_unread") == 0) gui_input_set_unread (); + else if (string_strcasecmp (argv[1], "set_unread_current_buffer") == 0) + gui_input_set_unread_current_buffer (); else if (string_strcasecmp (argv[1], "insert") == 0) { if (argc > 2) diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index a0544e601..dc4bd2887 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -1324,6 +1324,21 @@ gui_input_set_unread () } /* + * gui_input_set_unread_current_buffer: set unread marker for current buffer + */ + +void +gui_input_set_unread_current_buffer () +{ + if (gui_current_window + && (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED)) + gui_current_window->buffer->last_read_line = gui_current_window->buffer->last_line; + + /* refresh all windows */ + gui_window_redraw_buffer (gui_current_window->buffer); +} + +/* * gui_input_insert: insert a string in command line * (many default keys are bound to this function) */ diff --git a/src/gui/gui-input.h b/src/gui/gui-input.h index 17fd6a573..0182e8651 100644 --- a/src/gui/gui-input.h +++ b/src/gui/gui-input.h @@ -66,6 +66,7 @@ extern void gui_input_infobar_clear (); extern void gui_input_grab_key (); extern void gui_input_scroll_unread (); extern void gui_input_set_unread (); +extern void gui_input_set_unread_current_buffer (); extern void gui_input_insert (); /* input functions (GUI dependent) */ |