mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Remove scrollback_levelclear_levels setting and add a 'level' option to
'sb levelclear' to specify a comma separated list of levels. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4876 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
5e4c08d8a1
commit
86a5e8085a
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
/SB LEVELCLEAR
|
/SB LEVELCLEAR
|
||||||
- Remove lines with level matching one of those
|
- Remove lines with level matching one of those
|
||||||
specified in scrollback_levelclear_levels.
|
specified in the comma-separated list <level>.
|
||||||
/SB CLEAR
|
/SB CLEAR
|
||||||
- Clear screen, free all memory used by texts in window.
|
- Clear screen, free all memory used by texts in window.
|
||||||
/SB HOME
|
/SB HOME
|
||||||
|
@ -129,7 +129,7 @@ static void cmd_scrollback_clear(const char *data)
|
|||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYNTAX: SCROLLBACK LEVELCLEAR [-all] [<refnum>] */
|
/* SYNTAX: SCROLLBACK LEVELCLEAR [-all] [-level <level>] [<refnum>] */
|
||||||
static void cmd_scrollback_levelclear(const char *data)
|
static void cmd_scrollback_levelclear(const char *data)
|
||||||
{
|
{
|
||||||
WINDOW_REC *window;
|
WINDOW_REC *window;
|
||||||
@ -138,13 +138,16 @@ static void cmd_scrollback_levelclear(const char *data)
|
|||||||
void *free_arg;
|
void *free_arg;
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
int level;
|
int level;
|
||||||
|
char *levelarg;
|
||||||
|
|
||||||
g_return_if_fail(data != NULL);
|
g_return_if_fail(data != NULL);
|
||||||
|
|
||||||
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
|
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
|
||||||
"scrollback levelclear", &optlist, &refnum)) return;
|
"scrollback levelclear", &optlist, &refnum)) return;
|
||||||
|
|
||||||
level = settings_get_level("scrollback_levelclear_levels");
|
levelarg = g_hash_table_lookup(optlist, "level");
|
||||||
|
level = (levelarg == NULL || *levelarg == '\0') ? 0 :
|
||||||
|
level2bits(replace_chars(levelarg, ',', ' '));
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
return;
|
return;
|
||||||
@ -374,7 +377,6 @@ static void sig_away_changed(SERVER_REC *server)
|
|||||||
|
|
||||||
void textbuffer_commands_init(void)
|
void textbuffer_commands_init(void)
|
||||||
{
|
{
|
||||||
settings_add_level("misc", "scrollback_levelclear_levels", "crap clientcrap");
|
|
||||||
command_bind("clear", NULL, (SIGNAL_FUNC) cmd_clear);
|
command_bind("clear", NULL, (SIGNAL_FUNC) cmd_clear);
|
||||||
command_bind("window scroll", NULL, (SIGNAL_FUNC) cmd_window_scroll);
|
command_bind("window scroll", NULL, (SIGNAL_FUNC) cmd_window_scroll);
|
||||||
command_bind("scrollback", NULL, (SIGNAL_FUNC) cmd_scrollback);
|
command_bind("scrollback", NULL, (SIGNAL_FUNC) cmd_scrollback);
|
||||||
@ -388,7 +390,7 @@ void textbuffer_commands_init(void)
|
|||||||
|
|
||||||
command_set_options("clear", "all");
|
command_set_options("clear", "all");
|
||||||
command_set_options("scrollback clear", "all");
|
command_set_options("scrollback clear", "all");
|
||||||
command_set_options("scrollback levelclear", "all");
|
command_set_options("scrollback levelclear", "all -level");
|
||||||
|
|
||||||
signal_add("away mode changed", (SIGNAL_FUNC) sig_away_changed);
|
signal_add("away mode changed", (SIGNAL_FUNC) sig_away_changed);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user