summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-02-20 22:33:48 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-02-20 22:33:48 +0100
commitc9c8625581b2afba581e8832830a6662aac45c09 (patch)
tree6cfb1f87f441cbc23cbbee224b09dc1cfbfba2eb /src
parent77f645e8ae7abd62969ebd472c4a1d5b11306be0 (diff)
downloadweechat-c9c8625581b2afba581e8832830a6662aac45c09.zip
relay: fix up/down keys on relay buffer (closes #335)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/relay/relay-command.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c
index 279ae3a46..b6c958a06 100644
--- a/src/plugins/relay/relay-command.c
+++ b/src/plugins/relay/relay-command.c
@@ -311,6 +311,27 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
return WEECHAT_RC_OK;
}
+ if (weechat_strcasecmp (argv[1], "up") == 0)
+ {
+ if (relay_buffer && (relay_buffer_selected_line > 0))
+ {
+ relay_buffer_selected_line--;
+ relay_buffer_refresh (NULL);
+ }
+ return WEECHAT_RC_OK;
+ }
+
+ if (weechat_strcasecmp (argv[1], "down") == 0)
+ {
+ if (relay_buffer
+ && relay_buffer_selected_line < relay_client_count - 1)
+ {
+ relay_buffer_selected_line++;
+ relay_buffer_refresh (NULL);
+ }
+ return WEECHAT_RC_OK;
+ }
+
WEECHAT_COMMAND_ERROR;
}
@@ -320,24 +341,9 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
if (relay_buffer)
{
weechat_buffer_set (relay_buffer, "display", "1");
-
- if (argc > 1)
- {
- if (strcmp (argv[1], "up") == 0)
- {
- if (relay_buffer_selected_line > 0)
- relay_buffer_selected_line--;
- }
- else if (strcmp (argv[1], "down") == 0)
- {
- if (relay_buffer_selected_line < relay_client_count - 1)
- relay_buffer_selected_line++;
- }
- }
+ relay_buffer_refresh (NULL);
}
- relay_buffer_refresh (NULL);
-
return WEECHAT_RC_OK;
}