diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-18 12:17:21 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-18 12:17:21 +0100 |
commit | 8c13cab941c102488cc9d3a15b9488519d4052b9 (patch) | |
tree | 282c3fc5a22294bca28d32b1d2c529203269d0bc | |
parent | e0151b42a6cd27f48ca72e811eb2d6ddc72e65cb (diff) | |
download | weechat-8c13cab941c102488cc9d3a15b9488519d4052b9.zip |
Add new option weechat.look.highlight_tags (force highlight on tags)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | doc/de/autogen/user/weechat_options.txt | 5 | ||||
-rw-r--r-- | doc/en/autogen/user/weechat_options.txt | 5 | ||||
-rw-r--r-- | doc/fr/autogen/user/weechat_options.txt | 5 | ||||
-rw-r--r-- | doc/it/autogen/user/weechat_options.txt | 5 | ||||
-rw-r--r-- | po/cs.po | 15 | ||||
-rw-r--r-- | po/de.po | 18 | ||||
-rw-r--r-- | po/es.po | 16 | ||||
-rw-r--r-- | po/fr.po | 17 | ||||
-rw-r--r-- | po/hu.po | 11 | ||||
-rw-r--r-- | po/it.po | 17 | ||||
-rw-r--r-- | po/pl.po | 16 | ||||
-rw-r--r-- | po/pt_BR.po | 13 | ||||
-rw-r--r-- | po/ru.po | 11 | ||||
-rw-r--r-- | po/weechat.pot | 8 | ||||
-rw-r--r-- | src/core/wee-config.c | 38 | ||||
-rw-r--r-- | src/core/wee-config.h | 2 | ||||
-rw-r--r-- | src/gui/gui-line.c | 21 |
18 files changed, 211 insertions, 15 deletions
@@ -1,12 +1,13 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.3.5-dev, 2011-03-16 +v0.3.5-dev, 2011-03-18 Version 0.3.5 (under dev!) -------------------------- +* core: add new option weechat.look.highlight_tags (force highlight on tags) * core: fix bug with repeat of last completion ("%*"), which failed when many templates are used in completion * core: allow list of buffers in command /filter (exclusion with prefix "!") diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt index abe285562..ce08fb077 100644 --- a/doc/de/autogen/user/weechat_options.txt +++ b/doc/de/autogen/user/weechat_options.txt @@ -343,6 +343,11 @@ ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette (Standardwert: `""`) +* *weechat.look.highlight_tags* +** Beschreibung: `comma separated list of tags to highlight (case insensitive comparison, examples: "irc_notice" for IRC notices, "nick_flashcode" for messages from nick "FlashCode")` +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette (Standardwert: `""`) + * *weechat.look.hline_char* ** Beschreibung: `Das angegebene Zeichen wird genutzt um damit die horizontalen Linien zu zeichnen. Wird kein Zeichen angegeben zeichnet ncurses eine durchgezogene Linie. Dies kann allerdings bei einigen Terminals zu Fehlern führen, falls die URL Auswahl genutzt wird. Wide Chars sind für diese Option NICHT erlaubt.` ** Typ: Zeichenkette diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index 59cb5cd03..225b6b937 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -343,6 +343,11 @@ ** type: string ** values: any string (default value: `""`) +* *weechat.look.highlight_tags* +** description: `comma separated list of tags to highlight (case insensitive comparison, examples: "irc_notice" for IRC notices, "nick_flashcode" for messages from nick "FlashCode")` +** type: string +** values: any string (default value: `""`) + * *weechat.look.hline_char* ** description: `char used to draw horizontal separators around bars (empty value will draw a real line with ncurses, but may cause bugs with URL selection under some terminals), wide chars are NOT allowed here` ** type: string diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index 8085f5607..552c88ac8 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -343,6 +343,11 @@ ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: `""`) +* *weechat.look.highlight_tags* +** description: `liste des tags pour la notification (séparés par des virgules, la comparaison ne tient pas compte de la casse, exemples: "irc_notice" pour les notices IRC, "nick_flashcode" pour les messages du pseudo "FlashCode")` +** type: chaîne +** valeurs: toute chaîne (valeur par défaut: `""`) + * *weechat.look.hline_char* ** description: `caractère utilisé pour tracer les séparateurs horizontaux autour des barres (une valeur vide tracera une vraie ligne avec ncurses, mais peut causer des problèmes d'affichage avec la sélection d'URL sous certains terminaux), les caractères larges ne sont PAS autorisés ici` ** type: chaîne diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt index bcd57c9d7..4ea636f37 100644 --- a/doc/it/autogen/user/weechat_options.txt +++ b/doc/it/autogen/user/weechat_options.txt @@ -343,6 +343,11 @@ ** tipo: stringa ** valori: qualsiasi stringa (valore predefinito: `""`) +* *weechat.look.highlight_tags* +** descrizione: `comma separated list of tags to highlight (case insensitive comparison, examples: "irc_notice" for IRC notices, "nick_flashcode" for messages from nick "FlashCode")` +** tipo: stringa +** valori: qualsiasi stringa (valore predefinito: `""`) + * *weechat.look.hline_char* ** descrizione: `carattere usato per disegnare i separatori orizzontali intorno alle barre (un valore vuoto disegnerà una vera riga con ncurses, ma può causare errori con la selezione dell'URL in alcuni terminali), i caratteri wide NON sono consentiti` ** tipo: stringa @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-02-07 17:29+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1993,6 +1993,15 @@ msgstr "" #, fuzzy msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"čárkou oddělený seznam slov pro zvýraznění (neporovnává se velikost písmen, " +"slova mohou začínat nebo končit \"*\" pro částečnou schodu)" + +#, fuzzy +msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " "terminals), wide chars are NOT allowed here" @@ -7458,6 +7467,10 @@ msgstr "" msgid "Pointer" msgstr "Ukazatel" +#, fuzzy +#~ msgid "comma separated list of tags that will force highlight" +#~ msgstr "čárkami oddělený seznam slovníků, které použít pro tento buffer" + #~ msgid "%s%s: channel \"%s\" not found for \"%s\" command" #~ msgstr "%s%s: kanál \"%s\" nebyl nalezen příkazem \"%s\"" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-03-12 10:15+0100\n" "Last-Translator: Nils G.\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2156,6 +2156,16 @@ msgstr "" "\" oder \"|\"), das Suchmuster unterscheidet zwischen Groß-und " "Kleinschreibung. Beispiel: \"FlashCode|flashy\"" +#, fuzzy +msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"Durch Kommata getrennte Liste der hervorzuhebenden Wörter (Groß-/" +"Kleinschreibung wird nicht beachtet. Die Schlagwörter können mit \"*\", als " +"Joker, beginnen oder enden)" + msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " @@ -7787,6 +7797,12 @@ msgstr "Hashtable (Ausgabe)" msgid "Pointer" msgstr "Pointer" +#, fuzzy +#~ msgid "comma separated list of tags that will force highlight" +#~ msgstr "" +#~ "Durch Kommata getrennte Liste der Wörterbücher, die in diesem Buffer " +#~ "genutzt werden" + #~ msgid "%s%s: channel \"%s\" not found for \"%s\" command" #~ msgstr "%s%s: Channel \"%s\" für den \"%s\"-Befehl nicht gefunden" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-02-07 17:29+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2043,6 +2043,16 @@ msgstr "" #, fuzzy msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"lista separada por comas de palabras a resaltar (comparación insensible a " +"mayúsculas, las palabras pueden empezar o terminar con \"*\" para una " +"concordancia parcial)" + +#, fuzzy +msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " "terminals), wide chars are NOT allowed here" @@ -7641,6 +7651,10 @@ msgstr "Tabla hash (salida)" msgid "Pointer" msgstr "Puntero" +#, fuzzy +#~ msgid "comma separated list of tags that will force highlight" +#~ msgstr "lista separada por comas de diccionarios para usar en este buffer" + #~ msgid "%s%s: channel \"%s\" not found for \"%s\" command" #~ msgstr "%s%s: canal \"%s\" no encontrado para el comando \"%s\"" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" -"PO-Revision-Date: 2011-03-15 15:31+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" +"PO-Revision-Date: 2011-03-18 12:15+0100\n" "Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: French\n" @@ -2100,6 +2100,16 @@ msgstr "" "régulière est sensible à la casse, exemple: \"FlashCode|flashy\"" msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"liste des tags pour la notification (séparés par des virgules, la " +"comparaison ne tient pas compte de la casse, exemples: \"irc_notice\" pour " +"les notices IRC, \"nick_flashcode\" pour les messages du pseudo \"FlashCode" +"\")" + +msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " "terminals), wide chars are NOT allowed here" @@ -7650,6 +7660,9 @@ msgstr "Hashtable (sortie)" msgid "Pointer" msgstr "Pointeur" +#~ msgid "comma separated list of tags that will force highlight" +#~ msgstr "liste des tags (séparés par des virgules) qui forcent un highlight" + #~ msgid "%s%s: channel \"%s\" not found for \"%s\" command" #~ msgstr "%s%s: canal \"%s\" non trouvé pour la commande \"%s\"" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-02-07 17:29+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1778,6 +1778,15 @@ msgid "" "flashy\"" msgstr "" +#, fuzzy +msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"kiemelendő szavak vesszővel elválasztott listája (kis/nagybetűtől független " +"összehasonlítás, a szavak végére/elejére \"*\"-ot illesztve részleges keresés" + msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-03-09 09:29+0100\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2035,6 +2035,16 @@ msgstr "" "circondata da caratteri :(alfanumerici, \"-\", \"_\" or \"|\"), " "l'espressione regolare è esatta, esempio \"FlashCode|flashy\"" +#, fuzzy +msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"elenco separato da virgole di finestre da evidenziare (maiuscole/minuscole, " +"le parole potrebbero cominciare o terminare con \"*\" per un riscontro " +"parziale)" + msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " @@ -7545,6 +7555,11 @@ msgstr "Tabella hash (output)" msgid "Pointer" msgstr "Puntatore" +#, fuzzy +#~ msgid "comma separated list of tags that will force highlight" +#~ msgstr "" +#~ "elenco separato da virgole di dizionari da utilizzare su questo buffer" + #~ msgid "%s%s: channel \"%s\" not found for \"%s\" command" #~ msgstr "%s%s: canale \"%s\" non trovato per il comando \"%s\"" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-02-07 17:29+0100\n" "Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2051,6 +2051,16 @@ msgstr "" #, fuzzy msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"lista słów do podświetlania oddzielona przecinkami (porównanie wrażliwe na " +"wielkość znaków, słowa mogą się zaczynać lub kończyć \"*\" dla częściowego " +"dopasowania)" + +#, fuzzy +msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " "terminals), wide chars are NOT allowed here" @@ -7563,6 +7573,10 @@ msgstr "Hashtable (wyjście)" msgid "Pointer" msgstr "Wskaźnik" +#, fuzzy +#~ msgid "comma separated list of tags that will force highlight" +#~ msgstr "oddzielona przecinkami lista słowników do użycia w tym buforze" + #~ msgid "%s%s: channel \"%s\" not found for \"%s\" command" #~ msgstr "%s%s: nie znaleziono kanału \"%s\" dla komendy \"%s\" " diff --git a/po/pt_BR.po b/po/pt_BR.po index 8b84b1473..f5e707919 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-02-07 17:30+0100\n" "Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2037,6 +2037,17 @@ msgid "" "flashy\"" msgstr "" +# Does it worth translating 'case insensitive'? +#, fuzzy +msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"lista separada por vírgulas de palavras a serem destacadas (comparação case " +"insensitive, palavras podem começar ou terminar com \"*\" para coincidências " +"parciais)" + #, fuzzy msgid "" "char used to draw horizontal separators around bars (empty value will draw a " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: 2011-02-07 17:30+0100\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1787,6 +1787,15 @@ msgid "" "flashy\"" msgstr "" +#, fuzzy +msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" +"разделённый запятыми список подсвечиваемых слов (регистр учитывается, слова " +"могут начинаться или кончаться \"*\" для неполного соответствия)" + msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " diff --git a/po/weechat.pot b/po/weechat.pot index cfcee6906..b8fdb9ec4 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-03-16 09:26+0100\n" +"POT-Creation-Date: 2011-03-18 12:15+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -1537,6 +1537,12 @@ msgid "" msgstr "" msgid "" +"comma separated list of tags to highlight (case insensitive comparison, " +"examples: \"irc_notice\" for IRC notices, \"nick_flashcode\" for messages " +"from nick \"FlashCode\")" +msgstr "" + +msgid "" "char used to draw horizontal separators around bars (empty value will draw a " "real line with ncurses, but may cause bugs with URL selection under some " "terminals), wide chars are NOT allowed here" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 46a42d20f..91a4f1b8c 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -86,6 +86,7 @@ struct t_config_option *config_look_day_change; struct t_config_option *config_look_day_change_time_format; struct t_config_option *config_look_highlight; struct t_config_option *config_look_highlight_regex; +struct t_config_option *config_look_highlight_tags; struct t_config_option *config_look_hline_char; struct t_config_option *config_look_hotlist_names_count; struct t_config_option *config_look_hotlist_names_length; @@ -206,6 +207,8 @@ struct t_config_option *config_plugin_save_config_on_unload; struct t_hook *config_day_change_timer = NULL; int config_day_change_old_day = -1; regex_t *config_highlight_regex = NULL; +char **config_highlight_tags = NULL; +int config_num_highlight_tags = 0; /* @@ -325,6 +328,32 @@ config_change_highlight_regex (void *data, struct t_config_option *option) } /* + * config_change_highlight_tags: called when highlight_tags changes + */ + +void +config_change_highlight_tags (void *data, struct t_config_option *option) +{ + /* make C compiler happy */ + (void) data; + (void) option; + + if (config_highlight_tags) + { + string_free_split (config_highlight_tags); + config_highlight_tags = NULL; + } + config_num_highlight_tags = 0; + + if (CONFIG_STRING(config_look_highlight_tags) + && CONFIG_STRING(config_look_highlight_tags)[0]) + { + config_highlight_tags = string_split (CONFIG_STRING(config_look_highlight_tags), + ",", 0, 0, &config_num_highlight_tags); + } +} + +/* * config_change_hotlist: called when hotlist changes */ @@ -1528,6 +1557,13 @@ config_weechat_init_options () "(alphanumeric, \"-\", \"_\" or \"|\"), regular expression is case " "sensitive, example: \"FlashCode|flashy\""), NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_regex, NULL, NULL, NULL); + config_look_highlight_tags = config_file_new_option ( + weechat_config_file, ptr_section, + "highlight_tags", "string", + N_("comma separated list of tags to highlight (case insensitive " + "comparison, examples: \"irc_notice\" for IRC notices, " + "\"nick_flashcode\" for messages from nick \"FlashCode\")"), + NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_tags, NULL, NULL, NULL); config_look_hline_char = config_file_new_option ( weechat_config_file, ptr_section, "hline_char", "string", @@ -2371,6 +2407,8 @@ config_weechat_init () } if (!config_highlight_regex) config_change_highlight_regex (NULL, NULL); + if (!config_highlight_tags) + config_change_highlight_tags (NULL, NULL); return rc; } diff --git a/src/core/wee-config.h b/src/core/wee-config.h index e3052a87e..002e07ee4 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -219,6 +219,8 @@ extern struct t_config_option *config_plugin_path; extern struct t_config_option *config_plugin_save_config_on_unload; extern regex_t *config_highlight_regex; +extern char **config_highlight_tags; +extern int config_num_highlight_tags; extern struct t_config_option *config_weechat_debug_get (const char *plugin_name); diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index 747f39e92..1f46457ea 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -404,7 +404,7 @@ gui_line_get_nick_tag (struct t_gui_line *line) int gui_line_has_highlight (struct t_gui_line *line) { - int rc, i; + int rc, i, j, no_highlight; char *msg_no_color, *highlight_words; /* @@ -415,12 +415,27 @@ gui_line_has_highlight (struct t_gui_line *line) && (strcmp (line->data->buffer->highlight_words, "-") == 0)) return 0; - /* check if highlight is disabled for line */ + /* + * check if highlight is forced by a tag (with option highlight_tags) or + * disabled for line + */ + no_highlight = 0; for (i = 0; i < line->data->tags_count; i++) { + if (config_highlight_tags) + { + for (j = 0; j < config_num_highlight_tags; j++) + { + if (string_strcasecmp (line->data->tags_array[i], + config_highlight_tags[j]) == 0) + return 1; + } + } if (strcmp (line->data->tags_array[i], GUI_CHAT_TAG_NO_HIGHLIGHT) == 0) - return 0; + no_highlight = 1; } + if (no_highlight) + return 0; /* * check that line matches highlight tags, if any (if no tag is specified, |