mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
special vars: added PARSE_FLAG_ONLY_PARAMS. Theme loading now uses it so
you can use $C etc. in themes to print the active channel. printformat() also expands it now correctly to the server/target where the message was printed, not to the active window's server/target. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1802 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
8104317897
commit
7814192f03
4 changed files with 16 additions and 9 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "levels.h"
|
||||
|
||||
#include "fe-windows.h"
|
||||
#include "window-items.h"
|
||||
#include "formats.h"
|
||||
#include "themes.h"
|
||||
#include "translation.h"
|
||||
|
|
@ -388,12 +389,10 @@ static char *format_get_text_args(TEXT_DEST_REC *dest,
|
|||
/* argument */
|
||||
char *ret;
|
||||
|
||||
ret = parse_special((char **) &text,
|
||||
active_win == NULL ? NULL :
|
||||
active_win->active_server,
|
||||
active_win == NULL ? NULL :
|
||||
active_win->active, arglist,
|
||||
&need_free, NULL, 0);
|
||||
ret = parse_special((char **) &text, dest->server,
|
||||
dest->target == NULL ? NULL :
|
||||
window_item_find(dest->server, dest->target),
|
||||
arglist, &need_free, NULL, 0);
|
||||
|
||||
if (ret != NULL) {
|
||||
/* string shouldn't end with \003 or it could
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ static char *theme_replace_expand(THEME_REC *theme, int index,
|
|||
abstract = theme_format_expand_data(theme, (const char **) &abstract,
|
||||
default_fg, default_bg,
|
||||
last_fg, last_bg, flags);
|
||||
ret = parse_special_string(abstract, NULL, NULL, data, NULL, 0);
|
||||
ret = parse_special_string(abstract, NULL, NULL, data, NULL,
|
||||
PARSE_FLAG_ONLY_PARAMS);
|
||||
g_free(abstract);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -143,7 +144,7 @@ static void theme_format_append_variable(GString *str, const char **format)
|
|||
(*format)++;
|
||||
|
||||
value = parse_special((char **) format, NULL, NULL,
|
||||
args, &free_ret, NULL, 0);
|
||||
args, &free_ret, NULL, PARSE_FLAG_ONLY_PARAMS);
|
||||
if (free_ret) g_free(value);
|
||||
(*format)++;
|
||||
|
||||
|
|
@ -300,7 +301,8 @@ static char *theme_format_expand_abstract(THEME_REC *theme,
|
|||
g_free(tmp);
|
||||
}
|
||||
|
||||
ret = parse_special_string(abstract, NULL, NULL, data, NULL, 0);
|
||||
ret = parse_special_string(abstract, NULL, NULL, data, NULL,
|
||||
PARSE_FLAG_ONLY_PARAMS);
|
||||
g_free(abstract);
|
||||
g_free(data);
|
||||
abstract = ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue