summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-02-17 22:48:44 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-02-17 22:48:44 +0000
commit5cdcfdebb7aa8283189ab46f5a50a48c1c1f6b36 (patch)
treeb3c0fbac2f8b5a9492c78ca0fffabc7e54b41659 /src
parentca50f2c8fc5549bc3812aabca699c6f3a412f7e2 (diff)
downloadweechat-5cdcfdebb7aa8283189ab46f5a50a48c1c1f6b36.zip
Improved /help command output
Diffstat (limited to 'src')
-rw-r--r--src/common/command.c48
-rw-r--r--src/gui/curses/gui-display.c16
2 files changed, 26 insertions, 38 deletions
diff --git a/src/common/command.c b/src/common/command.c
index cbbadff5b..48e3f85f0 100644
--- a/src/common/command.c
+++ b/src/common/command.c
@@ -1148,29 +1148,31 @@ weechat_cmd_help (int argc, char **argv)
if (argc == 0)
{
- irc_display_prefix (NULL, PREFIX_INFO);
+ gui_printf (NULL, "\n");
gui_printf (NULL,
- _("> List of %s internal commands:\n"),
+ _("%s internal commands:\n"),
PACKAGE_NAME);
+ gui_printf (NULL, "\n");
for (i = 0; weechat_commands[i].command_name; i++)
{
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " %s",
+ gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " %s",
weechat_commands[i].command_name);
gui_printf (NULL, " - %s\n",
_(weechat_commands[i].command_description));
}
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf (NULL, _("> List of IRC commands:\n"));
+ gui_printf (NULL, "\n");
+ gui_printf (NULL, _("IRC commands:\n"));
+ gui_printf (NULL, "\n");
for (i = 0; irc_commands[i].command_name; i++)
+ {
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
{
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " %s",
+ gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " %s",
irc_commands[i].command_name);
gui_printf (NULL, " - %s\n",
_(irc_commands[i].command_description));
}
+ }
}
if (argc == 1)
{
@@ -1178,24 +1180,19 @@ weechat_cmd_help (int argc, char **argv)
{
if (strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
{
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf (NULL, _("> Help on %s internal command \""), PACKAGE_NAME);
- gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s",
- weechat_commands[i].command_name);
- gui_printf (NULL, "\":\n");
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf (NULL, _("Syntax: "));
- gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "/%s",
+ gui_printf (NULL, "\n");
+ gui_printf (NULL, "[w]");
+ gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " /%s",
weechat_commands[i].command_name);
if (weechat_commands[i].arguments &&
weechat_commands[i].arguments[0])
- gui_printf (NULL, " %s\n",
+ gui_printf (NULL, " %s\n",
_(weechat_commands[i].arguments));
else
gui_printf (NULL, "\n");
if (weechat_commands[i].arguments_description &&
weechat_commands[i].arguments_description[0])
- gui_printf (NULL, "%s\n",
+ gui_printf (NULL, "\n%s\n",
_(weechat_commands[i].arguments_description));
return 0;
}
@@ -1205,24 +1202,19 @@ weechat_cmd_help (int argc, char **argv)
if ((strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
&& (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg))
{
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf (NULL, _("> Help on IRC command \""));
- gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s",
- irc_commands[i].command_name);
- gui_printf (NULL, "\":\n");
- irc_display_prefix (NULL, PREFIX_INFO);
- gui_printf (NULL, _("Syntax: "));
- gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "/%s",
+ gui_printf (NULL, "\n");
+ gui_printf (NULL, "[i]");
+ gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " /%s",
irc_commands[i].command_name);
if (irc_commands[i].arguments &&
irc_commands[i].arguments[0])
- gui_printf (NULL, " %s\n",
+ gui_printf (NULL, " %s\n",
_(irc_commands[i].arguments));
else
gui_printf (NULL, "\n");
if (irc_commands[i].arguments_description &&
irc_commands[i].arguments_description[0])
- gui_printf (NULL, "%s\n",
+ gui_printf (NULL, "\n%s\n",
_(irc_commands[i].arguments_description));
return 0;
}
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c
index ec488e310..6fa24e0aa 100644
--- a/src/gui/curses/gui-display.c
+++ b/src/gui/curses/gui-display.c
@@ -401,7 +401,10 @@ gui_get_line_num_splits (t_gui_window *window, t_gui_line *line)
width = window->win_chat_width - line->length_align;
}
- return (length % width == 0) ? (length / width) : ((length / width) + 1);
+ if (length == 0)
+ return 1;
+ else
+ return (length % width == 0) ? (length / width) : ((length / width) + 1);
}
/*
@@ -2241,15 +2244,8 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
if (pos)
{
pos[0] = '\n';
- if ((buffer->num_displayed > 0) /*&& (gui_current_window->sub_lines == 0)*/)
- {
- /*if ((buffer->window->win_chat_cursor_y
- + gui_get_line_num_splits (buffer, buffer->last_line)) >
- (buffer->window->win_chat_height - 1))*/
- gui_draw_buffer_chat (buffer, 0);
- /*else
- gui_display_line (buffer, buffer->last_line, 1);*/
- }
+ if (buffer->num_displayed > 0)
+ gui_draw_buffer_chat (buffer, 0);
if (buffer->num_displayed == 0)
{
if (3 - buffer->last_line->line_with_message -