1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

Added numeric argument for /clear command (buffer number) (patch #5372)

This commit is contained in:
Sebastien Helleu
2007-02-03 08:49:23 +00:00
parent 0e113ded09
commit ef43b3e013
26 changed files with 3276 additions and 3026 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2007-01-21
ChangeLog - 2007-02-03
Version 0.2.4 (under dev!):
* added numeric argument for /clear command (buffer number) (patch #5372)
* fixed crash when /away command is issued with no server connection
(bug #18839)
* fixed crash when closing a buffer opened on many windows
+3 -2
View File
@@ -40,11 +40,12 @@ Befehl: auszuf
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
Fenster leeren
-all: alle Fenster leeren
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [Servername]</command>
+3 -2
View File
@@ -40,11 +40,12 @@ command: command to execute (a '/' is automatically added if not found at beginn
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
clear window(s)
-all: clear all windows
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [servername]</command>
+3 -2
View File
@@ -40,11 +40,12 @@ commande: commande
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | nombre]</command>
<programlisting>
effacer la/les fenêtre(s)
-all: effacer toutes les fenêtres
-all: effacer tous les tampons
nombre: effacer un tampon par son numéro
</programlisting>
<command>connect [nom_serveur]</command>
+228 -214
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+230 -215
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+219 -212
View File
File diff suppressed because it is too large Load Diff
+32 -9
View File
@@ -75,8 +75,9 @@ t_weechat_command weechat_commands[] =
N_("command: command to execute (a '/' is automatically added if not found at beginning of command)\n"),
"%w|%i", 0, MAX_ARGS, 1, NULL, weechat_cmd_builtin },
{ "clear", N_("clear window(s)"),
N_("[-all]"),
N_("-all: clear all windows"),
N_("[-all | number]"),
N_(" -all: clear all buffers\n"
"number: clear buffer by number"),
"-all", 0, 1, 0, weechat_cmd_clear, NULL },
{ "connect", N_("connect to a server"),
N_("[servername]"),
@@ -1405,8 +1406,8 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_buffer *buffer;
irc_find_context (server, channel, NULL, &buffer);
char *error;
long number;
if (argc == 1)
{
@@ -1414,15 +1415,37 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
gui_buffer_clear_all ();
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
{
buffer = gui_buffer_search_by_number (number);
if (!buffer)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s buffer not found for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
}
gui_buffer_clear (buffer);
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
}
}
}
else
{
irc_find_context (server, channel, NULL, &buffer);
gui_buffer_clear (buffer);
}
return 0;
}
+6
View File
@@ -378,6 +378,12 @@ gui_buffer_clear (t_gui_buffer *buffer)
{
t_gui_window *ptr_win;
t_gui_line *ptr_line;
if (!buffer)
return;
if (buffer->type == BUFFER_TYPE_DCC)
return;
/* remove buffer from hotlist */
hotlist_remove_buffer (buffer);
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2007-01-21
ChangeLog - 2007-02-03
Version 0.2.4 (under dev!):
* added numeric argument for /clear command (buffer number) (patch #5372)
* fixed crash when /away command is issued with no server connection
(bug #18839)
* fixed crash when closing a buffer opened on many windows
+3 -2
View File
@@ -40,11 +40,12 @@ Befehl: auszuf
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
Fenster leeren
-all: alle Fenster leeren
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [Servername]</command>
+3 -2
View File
@@ -40,11 +40,12 @@ command: command to execute (a '/' is automatically added if not found at beginn
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | number]</command>
<programlisting>
clear window(s)
-all: clear all windows
-all: clear all buffers
number: clear buffer by number
</programlisting>
<command>connect [servername]</command>
+3 -2
View File
@@ -40,11 +40,12 @@ commande: commande
</programlisting>
<command>clear [-all]</command>
<command>clear [-all | nombre]</command>
<programlisting>
effacer la/les fenêtre(s)
-all: effacer toutes les fenêtres
-all: effacer tous les tampons
nombre: effacer un tampon par son numéro
</programlisting>
<command>connect [nom_serveur]</command>
+228 -214
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+230 -215
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+228 -214
View File
File diff suppressed because it is too large Load Diff
+219 -212
View File
File diff suppressed because it is too large Load Diff
+32 -9
View File
@@ -75,8 +75,9 @@ t_weechat_command weechat_commands[] =
N_("command: command to execute (a '/' is automatically added if not found at beginning of command)\n"),
"%w|%i", 0, MAX_ARGS, 1, NULL, weechat_cmd_builtin },
{ "clear", N_("clear window(s)"),
N_("[-all]"),
N_("-all: clear all windows"),
N_("[-all | number]"),
N_(" -all: clear all buffers\n"
"number: clear buffer by number"),
"-all", 0, 1, 0, weechat_cmd_clear, NULL },
{ "connect", N_("connect to a server"),
N_("[servername]"),
@@ -1405,8 +1406,8 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_buffer *buffer;
irc_find_context (server, channel, NULL, &buffer);
char *error;
long number;
if (argc == 1)
{
@@ -1414,15 +1415,37 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
gui_buffer_clear_all ();
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
{
buffer = gui_buffer_search_by_number (number);
if (!buffer)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s buffer not found for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
}
gui_buffer_clear (buffer);
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
return -1;
}
}
}
else
{
irc_find_context (server, channel, NULL, &buffer);
gui_buffer_clear (buffer);
}
return 0;
}
+6
View File
@@ -378,6 +378,12 @@ gui_buffer_clear (t_gui_buffer *buffer)
{
t_gui_window *ptr_win;
t_gui_line *ptr_line;
if (!buffer)
return;
if (buffer->type == BUFFER_TYPE_DCC)
return;
/* remove buffer from hotlist */
hotlist_remove_buffer (buffer);