1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Template packing: After $variables the color could be anything, don't

even try to guess it.

Some changes to templates in theme. Nick mode is now separate argument.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1083 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-07 07:48:56 +00:00 committed by cras
parent 069d9f3f02
commit f8f6d7670a
3 changed files with 28 additions and 24 deletions

View File

@ -72,37 +72,40 @@ abstracts = {
## messages
##
# the basic styling of how to print message
msgnick = "<$0-> %|";
# the basic styling of how to print message, $0 = nick mode, $1 = nick
msgnick = "<$0$1-> %|";
# message from you is printed. "msgownnick" specifies the styling of the
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
# whole line.
# Example1: You want the message text to be green:
# ownmsgnick = "{msgnick $0-}%g";
# Example2.1: You want < and > chars also be white:
# ownmsgnick = "%W{msgnick $0-}%n";
# ownnick = "$0-";
# ownmsgnick = "{msgnick $0 $1-}%g";
# Example2.1: You want < and > chars to be yellow:
# ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
# (you'll also have to remove <> from replaces list above)
# Example2.2: But you still want to keep <> grey for other messages:
# pubmsgnick = "%K{msgnick $0-%K}%n";
# pubmsgmenick = "%K{msgnick $0-%K}%n";
# pubmsghinick = "%K{msgnick $1$0$2-%K}%n";
ownmsgnick = "{msgnick $0-}";
# pubmsgnick = "%K{msgnick $0 $1-%K}%n";
# pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
# pubmsghinick = "%K{msgnick $1 $0$2-%K}%n";
# ownprivmsgnick = "%K{msgnick $0-%K}%n";
# privmsgnick = "%K{msgnick %R$0-%K}%n";
# $0 = nick mode, $1 = nick
ownmsgnick = "{msgnick $0 $1-}";
ownnick = "%W$0-%n";
# public message in channel
pubmsgnick = "{msgnick $0-}";
# public message in channel, $0 = nick mode, $1 = nick
pubmsgnick = "{msgnick $0 $1-}";
pubnick = "%w$0-%n";
# public message in channel meant for me
pubmsgmenick = "{msgnick $0-}";
# public message in channel meant for me, $0 = nick mode, $1 = nick
pubmsgmenick = "{msgnick $0 $1-}";
menick = "%Y$0-%n";
# public highlighted message in channel
# $0 = highlight color, $1 = nick mode (@, +), $2 = nick
pubmsghinick = "{msgnick $1$0$2-}";
# $0 = highlight color, $1 = nick mode, $2 = nick
pubmsghinick = "{msgnick $1 $0$2-}";
# channel name is printed with message
msgchannel = "%K:%c$0-%n";
@ -114,11 +117,11 @@ abstracts = {
ownprivmsg = "[%r$0%K(%R$1-%K)%n] ";
# own private message in query
ownprivmsgnick = "{msgnick $0-}";
ownprivmsgnick = "{msgnick $0-}";
ownprivnick = "%W$0-%n";
# private message in query
privmsgnick = "{msgnick %R$0-%n}";
privmsgnick = "{msgnick %R$0-%n}";
##
## other IRC events

View File

@ -88,16 +88,16 @@ FORMAT_REC fecommon_core_formats[] = {
/* ---- */
{ NULL, "Messages", 0 },
{ "own_msg", "{ownmsgnick $2{ownnick $0}}$1", 3, { 0, 0, 0 } },
{ "own_msg_channel", "{ownmsgnick $3{ownnick $0}{msgchannel $1}}$2", 4, { 0, 0, 0, 0 } },
{ "own_msg", "{ownmsgnick $2 {ownnick $0}}$1", 3, { 0, 0, 0 } },
{ "own_msg_channel", "{ownmsgnick $3 {ownnick $0}{msgchannel $1}}$2", 4, { 0, 0, 0, 0 } },
{ "own_msg_private", "{ownprivmsg msg $0}$1", 2, { 0, 0 } },
{ "own_msg_private_query", "{ownprivmsgnick {ownprivnick $2}}$1", 3, { 0, 0, 0 } },
{ "pubmsg_me", "{pubmsgmenick $2{menick $0}}$1", 3, { 0, 0, 0 } },
{ "pubmsg_me_channel", "{pubmsgmenick $3{menick $0}{msgchannel $1}}$2", 4, { 0, 0, 0, 0 } },
{ "pubmsg_me", "{pubmsgmenick $2 {menick $0}}$1", 3, { 0, 0, 0 } },
{ "pubmsg_me_channel", "{pubmsgmenick $3 {menick $0}{msgchannel $1}}$2", 4, { 0, 0, 0, 0 } },
{ "pubmsg_hilight", "{pubmsghinick $0 $3 $1}$2", 4, { 0, 0, 0, 0 } },
{ "pubmsg_hilight_channel", "{pubmsghinick $0 $4 $1{msgchannel $2}}$3", 5, { 0, 0, 0, 0, 0 } },
{ "pubmsg", "{pubmsgnick $2{pubnick $0}}$1", 3, { 0, 0, 0 } },
{ "pubmsg_channel", "{pubmsgnick $3{pubnick $0}{msgchannel $1}}$2", 4, { 0, 0, 0, 0 } },
{ "pubmsg", "{pubmsgnick $2 {pubnick $0}}$1", 3, { 0, 0, 0 } },
{ "pubmsg_channel", "{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2", 4, { 0, 0, 0, 0 } },
{ "msg_private", "{privmsg $0 $1}$2", 3, { 0, 0, 0 } },
{ "msg_private_query", "{privmsgnick $0}$2", 3, { 0, 0, 0 } },
{ "no_msgs_got", "You have not received a message from anyone yet", 0 },

View File

@ -366,6 +366,7 @@ static char *theme_format_compress_colors(THEME_REC *theme, const char *format)
if (*format == '$') {
/* $variable, skrip it entirely */
theme_format_append_variable(str, &format);
last_color = '\0';
} else if (*format != '%') {
/* a normal character */
g_string_append_c(str, *format);