core: add text emphasis in messages when searching text in buffer

New options:
- weechat.look.emphasized_attributes
- weechat.color.emphasized
- weechat.color.emphasized_bg
v2.8-utf8proc
Sebastien Helleu 2013-08-16 16:16:37 +02:00
parent 170acfe6f2
commit c624960336
34 changed files with 762 additions and 56 deletions

View File

@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.2-dev, 2013-08-10
v0.4.2-dev, 2013-08-16
This document lists all changes for each version.
@ -14,6 +14,9 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Version 0.4.2 (under dev!)
--------------------------
* core: add text emphasis in messages when searching text in buffer, new
options: weechat.look.emphasized_attributes, weechat.color.emphasized,
weechat.color.emphasized_bg
* core: fix random crash on "/buffer close" with a buffer number (or a range of
buffers)
* core: optimize the removal of lines in buffers (a lot faster to clear/close

View File

@ -188,6 +188,16 @@
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `cyan`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** Beschreibung: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `yellow`)
* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
** Beschreibung: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `magenta`)
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** Beschreibung: `Textfarbe in der Eingabezeile bei Aktivität (z.B. beim Einfügen von Zeilen)`
** Typ: Farbe
@ -478,6 +488,11 @@
** Typ: boolesch
** Werte: on, off (Standardwert: `off`)
* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
** Beschreibung: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `""`)
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** Beschreibung: `eine durch Kommata getrennte Liste der hervorzuhebenden Wörter. Groß- und Kleinschreibung wird dabei standardmäßig nicht beachtet (um zwischen Groß-und Kleinschreibung zu unterscheiden muss am Wortanfang "(?-i)" genutzt werden). Schlagwörter können mit "*", als Joker, beginnen oder enden; Beipiel: "test,(?-i)*toto*,flash*"`
** Typ: Zeichenkette

View File

@ -188,6 +188,16 @@
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `cyan`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** description: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `yellow`)
* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
** description: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `magenta`)
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** description: `text color for actions in input line`
** type: color
@ -478,6 +488,11 @@
** type: boolean
** values: on, off (default value: `off`)
* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
** description: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
** type: string
** values: any string (default value: `""`)
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** description: `comma separated list of words to highlight; case insensitive comparison (use "(?-i)" at beginning of words to make them case sensitive), words may begin or end with "*" for partial match; example: "test,(?-i)*toto*,flash*"`
** type: string

View File

@ -772,6 +772,7 @@ All combinations are summarized in this table:
| @h(19) + "b" + "#" | @h(19)`b#` | input bar | Move cursor char char (used only in item "input_text")
| @h(19) + "b" + "i" | @h(19)`bi` | bars | Start item
| @h(19) + "b" + "l" (lower L) | @h(19)`bl` | bars | Start line item
| @h(19) + "E" | @h(19)`E` | chat + bars | Emphasize text _(new in version 0.4.2)_
| @h(19) + @h(1C) | @h(19)@h(1C) | chat + bars | Reset color (keep attributes)
| @h(1A) + ATTR | @h(1A)`*` | chat + bars | Set attribute
| @h(1B) + ATTR | @h(1B)`*` | chat + bars | Remove attribute
@ -823,6 +824,9 @@ Color codes using options (see 't_gui_color_enum', in file 'src/gui/gui-color.h'
| 37 | weechat.color.chat_prefix_buffer_inactive_buffer _(new in version 0.3.6)_
| 38 | weechat.color.chat_nick_offline _(new in version 0.3.9)_
| 39 | weechat.color.chat_nick_offline_highlight _(new in version 0.3.9)_
| 40 | weechat.color.chat_nick_prefix _(new in version 0.4.1)_
| 41 | weechat.color.chat_nick_suffix _(new in version 0.4.1)_
| 42 | weechat.color.emphasis _(new in version 0.4.2)_
|========================================
WeeChat colors are:

View File

@ -6294,6 +6294,9 @@ Arguments:
*** '-italic': remove italic
*** 'underline': set underline
*** '-underline': remove underline
*** 'emphasis': toggle the emphasis for text (note: this should be used only in
bars, because WeeChat uses text emphasis when searching text in buffer)
_(new in version 0.4.2)_
** bar color name:
*** 'bar_fg': foreground color for bar
*** 'bar_delim': delimiters color for bar

View File

@ -188,6 +188,16 @@
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `cyan`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** description: `couleur du texte pour le texte mis en valeur (par exemple lors de la recherche de texte); cette option est utilisée seulement si l'option weechat.look.emphasized_attributes est une chaîne vide (valeur par défaut)`
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `yellow`)
* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
** description: `couleur du fond pour le texte mis en valeur (par exemple lors de la recherche de texte); cette option est utilisée seulement si l'option weechat.look.emphasized_attributes est une chaîne vide (valeur par défaut)`
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `magenta`)
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** description: `couleur du texte pour les actions dans la ligne de saisie`
** type: couleur
@ -478,6 +488,11 @@
** type: booléen
** valeurs: on, off (valeur par défaut: `off`)
* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
** description: `attributs pour le texte mis en valeur: un ou plusieurs caractères d'attributs ("*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné); si la chaîne est vide, les couleurs weechat.color.emphasized* sont utilisées`
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `""`)
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** description: `liste des mots pour la notification séparés par des virgules; la comparaison est insensible à la casse (utilisez "(?-i)" au début des mots pour les rendre sensibles à la casse), les mots peuvent commencer ou se terminer par "*" pour une comparaison partielle; exemple: "test,(?-i)*toto*,flash*"`
** type: chaîne

View File

@ -6369,6 +6369,10 @@ Paramètres :
*** '-italic' : désactiver l'italique
*** 'underline' : activer le souligné
*** '-underline' : désactiver le souligné
*** 'emphasis' : activer/désactiver la mise en valeur du texte (note: cela ne
devrait être utilisé que dans les barres, car WeeChat utilise la mise en
valeur du texte lors de la recherche de texte dans le tampon)
_(nouveau dans la version 0.4.2)_
** nom d'une couleur de barre :
*** 'bar_fg' : couleur de texte pour la barre
*** 'bar_delim' : couleur des délimiteurs pour la barre

View File

@ -188,6 +188,16 @@
** tipo: colore
** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `cyan`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** descrizione: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** tipo: colore
** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `yellow`)
* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
** descrizione: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** tipo: colore
** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `magenta`)
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** descrizione: `colore del testo per le azioni sulla riga di input`
** tipo: colore
@ -478,6 +488,11 @@
** tipo: bool
** valori: on, off (valore predefinito: `off`)
* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
** descrizione: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `""`)
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** descrizione: `elenco separato da virgole di parole da notificare; confronto non sensibile alle maiuscole (usare "(?-i)" all'inizio delle parole per renderle sensibili alle maiuscole), le parole possono iniziare o terminare con "*" per la corrispondenza parziale; ad esempio: "test,(?-i)*tizio*,flash*"`
** tipo: stringa

View File

@ -6320,6 +6320,10 @@ Argomenti:
*** '-italic': rimuove corsivo
*** 'underline': imposta sottolineato
*** '-underline': rimuove sottolineato
// TRANSLATION MISSING
*** 'emphasis': toggle the emphasis for text (note: this should be used only in
bars, because WeeChat uses text emphasis when searching text in buffer)
_(new in version 0.4.2)_
** nome colore della barra:
*** 'bar_fg': colore di primo piano della barra
*** 'bar_delim': colore dei delimitatori della barra

View File

@ -188,6 +188,16 @@
** タイプ: 色
** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、下線は "_"。 (デフォルト値: `cyan`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** 説明: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** タイプ: 色
** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、下線は "_"。 (デフォルト値: `yellow`)
* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
** 説明: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** タイプ: 色
** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、下線は "_"。 (デフォルト値: `magenta`)
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** 説明: `入力がアクションの場合のテキスト色`
** タイプ: 色
@ -478,6 +488,11 @@
** タイプ: ブール
** 値: on, off (デフォルト値: `off`)
* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
** 説明: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
** タイプ: 文字列
** 値: 未制約文字列 (デフォルト値: `""`)
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** 説明: `コンマ区切りのハイライトされる単語リスト; 大文字小文字の区別無し (単語の最初に "(?-i)" をつければ区別有り)、部分マッチさせるには単語の最初か最後に "*" をつける; 例: "test,(?-i)*toto*,flash*"`
** タイプ: 文字列

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2647,6 +2647,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@ -3138,6 +3144,18 @@ msgstr "barva textu děličů času"
msgid "text color for values"
msgstr "barva textu pro hodnoty"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr "barva textu pro akce ve vstupní řádce"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-12 09:01+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-12 09:02+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@ -3017,6 +3017,12 @@ msgstr ""
"anderen Applikation nicht umgebrochen wird (diese Option ist standardmäßig "
"deaktiviert, da es zu schwerwiegenden Grafikfehlern kommen kann)"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -3586,6 +3592,18 @@ msgstr "Farbe in der das Trennzeichen für die Uhrzeit dargestellt werden soll"
msgid "text color for values"
msgstr "Farbe für Werte"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr ""
"Textfarbe in der Eingabezeile bei Aktivität (z.B. beim Einfügen von Zeilen)"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2801,6 +2801,12 @@ msgstr ""
"opción está desactivada por defecto porque puede causar serios errores de "
"visualización)"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -3325,6 +3331,18 @@ msgstr "color para los delimitadores de la hora"
msgid "text color for values"
msgstr "color para los valores"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr "color para acciones en la línea de entrada"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-12 20:43+0200\n"
"PO-Revision-Date: 2013-08-12 20:43+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-16 15:18+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -2934,6 +2934,16 @@ msgstr ""
"autre application (cette option est désactivée par défaut car elle peut "
"causer de sérieux problèmes d'affichages)"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
"attributs pour le texte mis en valeur: un ou plusieurs caractères "
"d'attributs (\"*\" pour du gras, \"!\" pour la vidéo inverse, \"_\" pour du "
"souligné); si la chaîne est vide, les couleurs weechat.color.emphasized* "
"sont utilisées"
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -3482,6 +3492,24 @@ msgstr "couleur du texte pour les délimiteurs de l'heure"
msgid "text color for values"
msgstr "couleur du texte pour les valeurs"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
"couleur du texte pour le texte mis en valeur (par exemple lors de la "
"recherche de texte); cette option est utilisée seulement si l'option weechat."
"look.emphasized_attributes est une chaîne vide (valeur par défaut)"
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
"couleur du fond pour le texte mis en valeur (par exemple lors de la "
"recherche de texte); cette option est utilisée seulement si l'option weechat."
"look.emphasized_attributes est une chaîne vide (valeur par défaut)"
msgid "text color for actions in input line"
msgstr "couleur du texte pour les actions dans la ligne de saisie"
@ -10500,6 +10528,17 @@ msgstr "Type"
msgid "Constants"
msgstr "Constantes"
#~ msgid "text color for emphasized text (for example when searching text)"
#~ msgstr ""
#~ "couleur du texte pour le texte mis en valeur (par exemple lors d'une "
#~ "recherche de texte)"
#~ msgid ""
#~ "background color for emphasized text (for example when searching text)"
#~ msgstr ""
#~ "couleur du fond pour le texte mis en valeur (par exemple lors de la "
#~ "recherche de texte)"
#~ msgid "time format for date displayed when day changed"
#~ msgstr "format de date pour la date affichée quand le jour a changé"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2297,6 +2297,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@ -2757,6 +2763,18 @@ msgstr "információs pult határolóinak színe"
msgid "text color for values"
msgstr "üzenetek színe"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
#, fuzzy
msgid "text color for actions in input line"
msgstr "kilépési nyíl színe"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2850,6 +2850,12 @@ msgstr ""
"applicazione (l'opzione è disabilitata per default, dato che può causare "
"seri errori di visualizzazione)"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -3385,6 +3391,18 @@ msgstr "colore del testo per i delimitator dell'orario"
msgid "text color for values"
msgstr "colore del testo per i valori"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr "colore del testo per le azioni sulla riga di input"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-02 08:50+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@ -2817,6 +2817,12 @@ msgstr ""
"ペーストする際にテキストの改行を行わない (致命的な表示上の問題を引き起こすた"
"め、このオプションはデフォルトで無効化されている)"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -3329,6 +3335,18 @@ msgstr "時間区切りのテキスト色"
msgid "text color for values"
msgstr "値のテキスト色"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr "入力がアクションの場合のテキスト色"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-02 08:50+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2874,6 +2874,12 @@ msgstr ""
"aplikacji (domyślnie ta opcja jest wyłączona, ponieważ może spowodować "
"poważne błędy wyświetlania)"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -3406,6 +3412,18 @@ msgstr "kolor separatora czasu"
msgid "text color for values"
msgstr "kolor wyświetlania wartości"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr "kolor akcji w wprowadzonej linii"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:42+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2722,6 +2722,12 @@ msgstr ""
"(esta opção é desabilitada por padrão porque pode causar sérios problemas de "
"visualização"
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@ -3226,6 +3232,18 @@ msgstr "cor do texto para delimitadores de tempo"
msgid "text color for values"
msgstr "cor de texto para valores"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr "cor de texto para ações de linha de entrada"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:42+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2319,6 +2319,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@ -2788,6 +2794,18 @@ msgstr "цвет разделителей информационной пане
msgid "text color for values"
msgstr "цвет чата"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
#, fuzzy
msgid "text color for actions in input line"
msgstr "цвет действий в поле ввода"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:42+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2060,6 +2060,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -2463,6 +2469,18 @@ msgstr ""
msgid "text color for values"
msgstr "değerler için metin rengi"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.1-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-08-11 19:52+0200\n"
"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2064,6 +2064,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
msgid ""
"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"
msgstr ""
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
@ -2467,6 +2473,18 @@ msgstr ""
msgid "text color for values"
msgstr ""
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
"string (default value)"
msgstr ""
msgid ""
"background color for emphasized text (for example when searching text); used "
"only if option weechat.look.emphasized_attributes is an empty string "
"(default value)"
msgstr ""
msgid "text color for actions in input line"
msgstr ""

View File

@ -101,6 +101,7 @@ struct t_config_option *config_look_confirm_quit;
struct t_config_option *config_look_day_change;
struct t_config_option *config_look_day_change_time_format;
struct t_config_option *config_look_eat_newline_glitch;
struct t_config_option *config_look_emphasized_attributes;
struct t_config_option *config_look_highlight;
struct t_config_option *config_look_highlight_regex;
struct t_config_option *config_look_highlight_tags;
@ -198,6 +199,8 @@ struct t_config_option *config_color_chat_text_found_bg;
struct t_config_option *config_color_chat_time;
struct t_config_option *config_color_chat_time_delimiters;
struct t_config_option *config_color_chat_value;
struct t_config_option *config_color_emphasized;
struct t_config_option *config_color_emphasized_bg;
struct t_config_option *config_color_input_actions;
struct t_config_option *config_color_input_text_not_found;
struct t_config_option *config_color_separator;
@ -262,6 +265,7 @@ int config_length_nick_prefix_suffix = 0;
int config_length_prefix_same_nick = 0;
struct t_hook *config_day_change_timer = NULL;
int config_day_change_old_day = -1;
int config_emphasized_attributes = 0;
regex_t *config_highlight_regex = NULL;
char **config_highlight_tags = NULL;
int config_num_highlight_tags = 0;
@ -482,6 +486,34 @@ config_change_eat_newline_glitch (void *data, struct t_config_option *option)
}
}
/*
* Callback for changes on option "weechat.look.emphasized_attributes".
*/
void
config_change_emphasized_attributes (void *data, struct t_config_option *option)
{
int i;
const char *ptr_attr;
/* make C compiler happy */
(void) data;
(void) option;
config_emphasized_attributes = 0;
ptr_attr = CONFIG_STRING(config_look_emphasized_attributes);
if (ptr_attr)
{
for (i = 0; ptr_attr[i]; i++)
{
config_emphasized_attributes |= gui_color_attr_get_flag (ptr_attr[i]);
}
}
gui_window_ask_refresh (1);
}
/*
* Callback for changes on option "weechat.look.highlight_regex".
*/
@ -2065,6 +2097,13 @@ config_weechat_init_options ()
"display bugs)"),
NULL, 0, 0, "off", NULL, 0, NULL, NULL,
&config_change_eat_newline_glitch, NULL, NULL, NULL);
config_look_emphasized_attributes = config_file_new_option (
weechat_config_file, ptr_section,
"emphasized_attributes", "string",
N_("attributes for emphasized text: one or more attribute chars ("
"\"*\" for bold, \"!\" for reverse, \"_\" for underline); if the "
"string is empty, the colors weechat.color.emphasized* are used"),
NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_emphasized_attributes, NULL, NULL, NULL);
config_look_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"highlight", "string",
@ -2737,6 +2776,23 @@ config_weechat_init_options ()
N_("text color for values"),
NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* emphasis (chat/bars) */
config_color_emphasized = config_file_new_option (
weechat_config_file, ptr_section,
"emphasized", "color",
N_("text color for emphasized text (for example when searching text); "
"this option is used only if option weechat.look.emphasized_attributes "
"is an empty string (default value)"),
NULL, GUI_COLOR_EMPHASIS, 0, "yellow", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_emphasized_bg = config_file_new_option (
weechat_config_file, ptr_section,
"emphasized_bg", "color",
N_("background color for emphasized text (for example when searching "
"text); used only if option weechat.look.emphasized_attributes is an "
"empty string (default value)"),
NULL, -1, 0, "magenta", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* input bar */
config_color_input_actions = config_file_new_option (
weechat_config_file, ptr_section,

View File

@ -118,6 +118,7 @@ extern struct t_config_option *config_look_confirm_quit;
extern struct t_config_option *config_look_day_change;
extern struct t_config_option *config_look_day_change_time_format;
extern struct t_config_option *config_look_eat_newline_glitch;
extern struct t_config_option *config_look_emphasized_attributes;
extern struct t_config_option *config_look_highlight;
extern struct t_config_option *config_look_highlight_regex;
extern struct t_config_option *config_look_highlight_tags;
@ -213,6 +214,8 @@ extern struct t_config_option *config_color_chat_text_found_bg;
extern struct t_config_option *config_color_chat_time;
extern struct t_config_option *config_color_chat_time_delimiters;
extern struct t_config_option *config_color_chat_value;
extern struct t_config_option *config_color_emphasized;
extern struct t_config_option *config_color_emphasized_bg;
extern struct t_config_option *config_color_input_actions;
extern struct t_config_option *config_color_input_text_not_found;
extern struct t_config_option *config_color_separator;
@ -265,6 +268,7 @@ extern struct t_config_option *config_plugin_save_config_on_unload;
extern int config_length_nick_prefix_suffix;
extern int config_length_prefix_same_nick;
extern int config_emphasized_attributes;
extern regex_t *config_highlight_regex;
extern char **config_highlight_tags;
extern int config_num_highlight_tags;

View File

@ -204,6 +204,10 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
gui_window_string_apply_color_pair ((unsigned char **)&string,
GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar);
break;
case GUI_COLOR_EMPHASIS_CHAR: /* emphasis */
string++;
gui_window_toggle_emphasis ();
break;
case GUI_COLOR_BAR_CHAR: /* bar color */
switch (string[1])
{
@ -364,6 +368,12 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
if (output)
free (output);
if (gui_window_current_emphasis)
{
gui_window_emphasize (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
*x, *y, size_on_screen);
}
*x += size_on_screen;
}
}
@ -437,6 +447,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
index_subitem = -1;
index_line = 0;
gui_window_current_emphasis = 0;
filling = gui_bar_get_filling (bar_window->bar);
content = gui_bar_window_content_get_with_filling (bar_window, window);

View File

@ -262,6 +262,11 @@ gui_chat_string_next_char (struct t_gui_window *window, struct t_gui_line *line,
gui_window_string_apply_color_pair ((unsigned char **)&string,
(apply_style) ? GUI_WINDOW_OBJECTS(window)->win_chat : NULL);
break;
case GUI_COLOR_EMPHASIS_CHAR: /* emphasis */
string++;
if (apply_style)
gui_window_toggle_emphasis ();
break;
case GUI_COLOR_BAR_CHAR: /* bar color */
string++;
switch (string[0])
@ -402,6 +407,13 @@ gui_chat_display_word_raw (struct t_gui_window *window, struct t_gui_line *line,
"%s", (output) ? output : utf_char);
if (output)
free (output);
if (gui_window_current_emphasis)
{
gui_window_emphasize (GUI_WINDOW_OBJECTS(window)->win_chat,
x, window->win_chat_cursor_y,
size_on_screen);
}
}
chars_displayed += size_on_screen;
}
@ -432,10 +444,6 @@ gui_chat_display_word (struct t_gui_window *window,
char *data, *ptr_data, *end_line, saved_char, str_space[] = " ";
int chars_displayed, pos_saved_char, chars_to_display, num_displayed;
int length_align;
attr_t attrs;
attr_t *ptr_attrs;
short pair;
short *ptr_pair;
chars_displayed = 0;
@ -481,17 +489,12 @@ gui_chat_display_word (struct t_gui_window *window,
&& CONFIG_STRING(config_look_prefix_suffix)[0]
&& line->data->date > 0)
{
attrs = 0;
pair = 0;
if (!simulate)
{
ptr_attrs = &attrs;
ptr_pair = &pair;
wattr_get (GUI_WINDOW_OBJECTS(window)->win_chat,
ptr_attrs, ptr_pair, NULL);
gui_window_save_style ();
gui_window_save_style (GUI_WINDOW_OBJECTS(window)->win_chat);
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_PREFIX_SUFFIX);
gui_window_current_emphasis = 0;
}
chars_displayed += gui_chat_display_word_raw (window, line,
CONFIG_STRING(config_look_prefix_suffix),
@ -506,16 +509,7 @@ gui_chat_display_word (struct t_gui_window *window,
nick_offline);
window->win_chat_cursor_x += gui_chat_strlen_screen (str_space);
if (!simulate)
{
wattr_set (GUI_WINDOW_OBJECTS(window)->win_chat, attrs, pair, NULL);
/*
* for unknown reason, the wattr_set function sometimes
* fails to set the color pair under FreeBSD, so we force
* it again with wcolor_set
*/
wcolor_set (GUI_WINDOW_OBJECTS(window)->win_chat, pair, NULL);
gui_window_restore_style ();
}
gui_window_restore_style (GUI_WINDOW_OBJECTS(window)->win_chat);
}
if (window->win_chat_cursor_y < window->coords_size)
window->coords[window->win_chat_cursor_y].data = (char *)word + (ptr_data - data);
@ -1130,7 +1124,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
int word_start_offset, word_end_offset;
int word_length_with_spaces, word_length;
char *ptr_data, *ptr_end_offset, *next_char;
char *ptr_style, *message_with_tags;
char *ptr_style, *message_with_tags, *message_with_search;
if (!line)
return 0;
@ -1152,6 +1146,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
num_lines = gui_chat_display_line (window, line, 0, 1);
window->win_chat_cursor_x = x;
window->win_chat_cursor_y = y;
gui_window_current_emphasis = 0;
}
/* calculate marker position (maybe not used for this line!) */
@ -1205,6 +1200,16 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
gui_chat_build_string_message_tags (line) : NULL;
ptr_data = (message_with_tags) ?
message_with_tags : line->data->message;
message_with_search = NULL;
if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
{
message_with_search = gui_color_emphasize (ptr_data,
window->buffer->input_buffer,
window->buffer->text_search_exact,
NULL);
if (message_with_search)
ptr_data = message_with_search;
}
while (ptr_data && ptr_data[0])
{
gui_chat_get_word_info (window,
@ -1295,6 +1300,8 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
}
if (message_with_tags)
free (message_with_tags);
if (message_with_search)
free (message_with_search);
}
if (marker_line)

View File

@ -1434,6 +1434,7 @@ gui_color_init_weechat ()
gui_color_build (GUI_COLOR_CHAT_NICK_OFFLINE_HIGHLIGHT, CONFIG_COLOR(config_color_chat_nick_offline_highlight), CONFIG_COLOR(config_color_chat_nick_offline_highlight_bg));
gui_color_build (GUI_COLOR_CHAT_NICK_PREFIX, CONFIG_COLOR(config_color_chat_nick_prefix), CONFIG_COLOR(config_color_chat_bg));
gui_color_build (GUI_COLOR_CHAT_NICK_SUFFIX, CONFIG_COLOR(config_color_chat_nick_suffix), CONFIG_COLOR(config_color_chat_bg));
gui_color_build (GUI_COLOR_EMPHASIS, CONFIG_COLOR(config_color_emphasized), CONFIG_COLOR(config_color_emphasized_bg));
/*
* define old nick colors for compatibility on /upgrade with previous

View File

@ -57,11 +57,16 @@
#include "gui-curses.h"
#define GUI_WINDOW_MAX_SAVED_STYLES 32
int gui_window_current_style_fg; /* current foreground color */
int gui_window_current_style_bg; /* current background color */
int gui_window_current_style_attr; /* current attributes (bold, ..) */
int gui_window_current_color_attr; /* attr sum of last color(s) used */
int gui_window_saved_style[4]; /* current style saved */
int gui_window_current_emphasis; /* 1 if text emphasis is enabled */
struct t_gui_window_saved_style gui_window_saved_style[GUI_WINDOW_MAX_SAVED_STYLES];
/* circular list of saved styles */
int gui_window_saved_style_index = 0; /* index in list of savec styles */
/*
@ -218,12 +223,28 @@ gui_window_clrtoeol (WINDOW *window)
*/
void
gui_window_save_style ()
gui_window_save_style (WINDOW *window)
{
gui_window_saved_style[0] = gui_window_current_style_fg;
gui_window_saved_style[1] = gui_window_current_style_bg;
gui_window_saved_style[2] = gui_window_current_style_attr;
gui_window_saved_style[3] = gui_window_current_color_attr;
struct t_gui_window_saved_style *ptr_saved_style;
attr_t *ptr_attrs;
short *ptr_pair;
/* get pointer on saved style */
ptr_saved_style = &gui_window_saved_style[gui_window_saved_style_index];
/* save current style */
ptr_saved_style->style_fg = gui_window_current_style_fg;
ptr_saved_style->style_bg = gui_window_current_style_bg;
ptr_saved_style->color_attr = gui_window_current_color_attr;
ptr_saved_style->emphasis = gui_window_current_emphasis;
ptr_attrs = &ptr_saved_style->attrs;
ptr_pair = &ptr_saved_style->pair;
wattr_get (window, ptr_attrs, ptr_pair, NULL);
/* increment style index (circular list) */
gui_window_saved_style_index++;
if (gui_window_saved_style_index >= GUI_WINDOW_MAX_SAVED_STYLES)
gui_window_saved_style_index = 0;
}
/*
@ -231,12 +252,30 @@ gui_window_save_style ()
*/
void
gui_window_restore_style ()
gui_window_restore_style (WINDOW *window)
{
gui_window_current_style_fg = gui_window_saved_style[0];
gui_window_current_style_bg = gui_window_saved_style[1];
gui_window_current_style_attr = gui_window_saved_style[2];
gui_window_current_color_attr = gui_window_saved_style[3];
struct t_gui_window_saved_style *ptr_saved_style;
/* decrement style index (circular list) */
gui_window_saved_style_index--;
if (gui_window_saved_style_index < 0)
gui_window_saved_style_index = GUI_WINDOW_MAX_SAVED_STYLES - 1;
/* get pointer on saved style */
ptr_saved_style = &gui_window_saved_style[gui_window_saved_style_index];
/* restore style */
gui_window_current_style_fg = ptr_saved_style->style_fg;
gui_window_current_style_bg = ptr_saved_style->style_bg;
gui_window_current_color_attr = ptr_saved_style->color_attr;
gui_window_current_emphasis = ptr_saved_style->emphasis;
wattr_set (window, ptr_saved_style->attrs, ptr_saved_style->pair, NULL);
/*
* for unknown reason, the wattr_set function sometimes
* fails to set the color pair under FreeBSD, so we force
* it again with wcolor_set
*/
wcolor_set (window, ptr_saved_style->pair, NULL);
}
/*
@ -248,7 +287,6 @@ gui_window_reset_style (WINDOW *window, int weechat_color)
{
gui_window_current_style_fg = -1;
gui_window_current_style_bg = -1;
gui_window_current_style_attr = 0;
gui_window_current_color_attr = 0;
wattroff (window, A_BOLD | A_UNDERLINE | A_REVERSE);
@ -406,11 +444,10 @@ gui_window_set_custom_color_fg (WINDOW *window, int fg)
void
gui_window_set_custom_color_bg (WINDOW *window, int bg)
{
int current_attr, current_fg;
int current_fg;
if (bg >= 0)
{
current_attr = gui_window_current_style_attr;
current_fg = gui_window_current_style_fg;
if ((bg > 0) && (bg & GUI_COLOR_EXTENDED_FLAG))
@ -422,7 +459,6 @@ gui_window_set_custom_color_bg (WINDOW *window, int bg)
else if ((bg & GUI_COLOR_EXTENDED_MASK) < GUI_CURSES_NUM_WEECHAT_COLORS)
{
bg &= GUI_COLOR_EXTENDED_MASK;
gui_window_set_color_style (window, current_attr);
gui_window_set_color (window, current_fg,
(gui_color_term_colors >= 16) ?
gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground);
@ -514,6 +550,56 @@ gui_window_set_custom_color_pair (WINDOW *window, int pair)
}
}
/*
* Toggles text emphasis.
*/
void
gui_window_toggle_emphasis ()
{
gui_window_current_emphasis ^= 1;
}
/*
* Emphasizes some chars already displayed in a window, either using a color
* (from config options), or by doing an exclusive or (XOR) with attributes
* (like reverse video).
*
* It is used for example when searching a string in buffer.
*/
void
gui_window_emphasize (WINDOW *window, int x, int y, int count)
{
attr_t attrs, *ptr_attrs;
short pair, *ptr_pair;
if (config_emphasized_attributes == 0)
{
/* use color for emphasis (from config) */
mvwchgat (window, y, x, count,
gui_color[GUI_COLOR_EMPHASIS]->attributes,
gui_color_weechat_get_pair (GUI_COLOR_EMPHASIS), NULL);
}
else
{
/* exclusive or (XOR) with attributes */
ptr_attrs = &attrs;
ptr_pair = &pair;
wattr_get (window, ptr_attrs, ptr_pair, NULL);
if (config_emphasized_attributes & GUI_COLOR_EXTENDED_BOLD_FLAG)
attrs ^= A_BOLD;
if (config_emphasized_attributes & GUI_COLOR_EXTENDED_REVERSE_FLAG)
attrs ^= A_REVERSE;
if (config_emphasized_attributes & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
attrs ^= A_UNDERLINE;
mvwchgat (window, y, x, count, attrs, pair, NULL);
}
/* move the cursor after the text (mvwchgat does not move cursor) */
wmove (window, y, x + count);
}
/*
* Applies foreground color code in string and moves string pointer after color
* in string.

View File

@ -45,6 +45,16 @@ struct t_gui_bar_window;
#define GUI_BAR_WINDOW_OBJECTS(bar_window) \
((struct t_gui_bar_window_curses_objects *)(bar_window->gui_objects))
struct t_gui_window_saved_style
{
int style_fg;
int style_bg;
int color_attr;
int emphasis;
attr_t attrs;
short pair;
};
struct t_gui_window_curses_objects
{
WINDOW *win_chat; /* chat window (example: channel) */
@ -66,6 +76,7 @@ extern int gui_color_pairs_auto_reset;
extern int gui_color_pairs_auto_reset_pending;
extern time_t gui_color_pairs_auto_reset_last;
extern int gui_color_buffer_refresh_needed;
extern int gui_window_current_emphasis;
/* color functions */
extern int gui_color_get_pair (int fg, int bg);
@ -88,6 +99,8 @@ extern void gui_window_read_terminal_size ();
extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer);
extern void gui_window_clear (WINDOW *window, int fg, int bg);
extern void gui_window_clrtoeol (WINDOW *window);
extern void gui_window_save_style (WINDOW *window);
extern void gui_window_restore_style (WINDOW *window);
extern void gui_window_reset_style (WINDOW *window, int num_color);
extern void gui_window_reset_color (WINDOW *window, int num_color);
extern void gui_window_set_color_style (WINDOW *window, int style);
@ -98,6 +111,8 @@ extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg);
extern void gui_window_set_custom_color_pair (WINDOW *window, int pair);
extern void gui_window_set_custom_color_fg (WINDOW *window, int fg);
extern void gui_window_set_custom_color_bg (WINDOW *window, int bg);
extern void gui_window_toggle_emphasis ();
extern void gui_window_emphasize (WINDOW *window, int x, int y, int count);
extern void gui_window_string_apply_color_fg (unsigned char **str,
WINDOW *window);
extern void gui_window_string_apply_color_bg (unsigned char **str,
@ -112,8 +127,6 @@ extern void gui_window_string_apply_color_set_attr (unsigned char **str,
WINDOW *window);
extern void gui_window_string_apply_color_remove_attr (unsigned char **str,
WINDOW *window);
extern void gui_window_apply_color (unsigned char **str, WINDOW *window,
int apply_bar_colors);
extern void gui_window_set_title (const char *title);
#endif /* __WEECHAT_GUI_CURSES_H */

View File

@ -241,6 +241,8 @@ gui_chat_string_add_offset_screen (const char *string, int offset_screen)
/*
* Gets real position in string (ignoring formatting chars like
* colors/attributes).
*
* Returns real position, in bytes.
*/
int
@ -275,6 +277,36 @@ gui_chat_string_real_pos (const char *string, int pos)
return 0 + (real_pos - string);
}
/*
* Gets real position in string (ignoring formatting chars like
* colors/attributes).
*
* Returns position, in number of UTF-8 chars.
*/
int
gui_chat_string_pos (const char *string, int real_pos)
{
const char *ptr_string, *limit;
int count;
count = 0;
ptr_string = string;
limit = ptr_string + real_pos;
while (ptr_string && ptr_string[0] && (ptr_string < limit))
{
ptr_string = gui_chat_string_next_char (NULL, NULL,
(unsigned char *)ptr_string,
0, 0, 0);
if (ptr_string)
{
ptr_string = utf8_next_char (ptr_string);
count++;
}
}
return count;
}
/*
* Returns info about next word: beginning, end, length.
*

View File

@ -71,6 +71,7 @@ extern char *gui_chat_string_add_offset (const char *string, int offset);
extern char *gui_chat_string_add_offset_screen (const char *string,
int offset_screen);
extern int gui_chat_string_real_pos (const char *string, int pos);
extern int gui_chat_string_pos (const char *string, int real_pos);
extern void gui_chat_get_word_info (struct t_gui_window *window,
const char *data, int *word_start_offset,
int *word_end_offset,

View File

@ -40,6 +40,7 @@
#include "../core/wee-utf8.h"
#include "../plugins/plugin.h"
#include "gui-color.h"
#include "gui-chat.h"
#include "gui-window.h"
@ -171,6 +172,13 @@ gui_color_get_custom (const char *color_name)
GUI_COLOR_COLOR_CHAR,
GUI_COLOR_RESET_CHAR);
}
else if (string_strcasecmp (color_name, "emphasis") == 0)
{
snprintf (color[index_color], sizeof (color[index_color]),
"%c%c",
GUI_COLOR_COLOR_CHAR,
GUI_COLOR_EMPHASIS_CHAR);
}
else if (string_strcasecmp (color_name, "bold") == 0)
{
snprintf (color[index_color], sizeof (color[index_color]),
@ -518,6 +526,9 @@ gui_color_decode (const char *string, const char *replacement)
&& (isdigit (ptr_string[5])))
ptr_string += 6;
break;
case GUI_COLOR_EMPHASIS_CHAR:
ptr_string++;
break;
case GUI_COLOR_BAR_CHAR:
ptr_string++;
switch (ptr_string[0])
@ -582,6 +593,155 @@ gui_color_decode (const char *string, const char *replacement)
return (char *)out;
}
/*
* Emphasizes a string or regular expression in a string (which can contain
* colors).
*
* Argument "case_sensitive" is used only for "search", if the "regex" is NULL.
*
* Returns string with the search string/regex emphasized, NULL if error.
*
* Note: result must be freed after use.
*/
char *
gui_color_emphasize (const char *string,
const char *search, int case_sensitive,
regex_t *regex)
{
regmatch_t regex_match;
char *result, *result2, *string_no_color, *pos;
const char *ptr_string, *ptr_no_color, *color_emphasis;
int rc, length_search, length_emphasis, length_result;
int pos1, pos2, real_pos1, real_pos2, count_emphasis;
if (!string && !regex)
return NULL;
color_emphasis = gui_color_get_custom ("emphasis");
if (!color_emphasis)
return NULL;
length_emphasis = strlen (color_emphasis);
/*
* allocate space for 8 emphasized strings (8 before + 8 after = 16);
* more space will be allocated later (if there are more than 8 emphasized
* strings)
*/
length_result = strlen (string) + (length_emphasis * 2 * 8) + 1;
result = malloc (length_result);
if (!result)
return NULL;
result[0] = '\0';
/*
* build a string without color codes to search in this one (then with the
* position of text found, we will retrieve position in original string,
* which can contain color codes)
*/
string_no_color = gui_color_decode (string, NULL);
if (!string_no_color)
{
free (result);
return NULL;
}
length_search = (search) ? strlen (search) : 0;
ptr_string = string;
ptr_no_color = string_no_color;
count_emphasis = 0;
while (ptr_no_color && ptr_no_color[0])
{
if (regex)
{
/* search next match using the regex */
rc = regexec (regex, ptr_no_color, 1, &regex_match, 0);
/*
* no match found: exit the loop (if rm_no == 0, it is an empty
* match at beginning of string: we consider there is no match, to
* prevent an infinite loop)
*/
if ((rc != 0) || (regex_match.rm_so < 0) || (regex_match.rm_eo <= 0))
{
strcat (result, ptr_string);
break;
}
pos1 = regex_match.rm_so;
pos2 = regex_match.rm_eo;
}
else
{
/* search next match in the string */
if (case_sensitive)
pos = strstr (ptr_no_color, search);
else
pos = string_strcasestr (ptr_no_color, search);
if (!pos)
{
strcat (result, ptr_string);
break;
}
pos1 = pos - ptr_no_color;
pos2 = pos1 + length_search;
if (pos2 <= 0)
{
strcat (result, ptr_string);
break;
}
}
/*
* find the position of match in the original string (which can contain
* color codes)
*/
real_pos1 = gui_chat_string_real_pos (ptr_string,
gui_chat_string_pos (ptr_no_color, pos1));
real_pos2 = gui_chat_string_real_pos (ptr_string,
gui_chat_string_pos (ptr_no_color, pos2));
/*
* concatenate following strings to the result:
* - beginning of string (before match)
* - emphasis color code
* - the matching string
* - emphasis color code
*/
if (real_pos1 > 0)
strncat (result, ptr_string, real_pos1);
strcat (result, color_emphasis);
strncat (result, ptr_string + real_pos1, real_pos2 - real_pos1);
strcat (result, color_emphasis);
/* restart next loop after the matching string */
ptr_string += real_pos2;
ptr_no_color += pos2;
/* check if we should allocate more space for emphasis color codes */
count_emphasis++;
if (count_emphasis == 8)
{
/* allocate more space for emphasis color codes */
length_result += (length_emphasis * 2 * 8);
result2 = realloc (result, length_result);
if (!result2)
{
free (result);
return NULL;
}
result = result2;
count_emphasis = 0;
}
}
free (string_no_color);
return result;
}
/*
* Frees a color.
*/

View File

@ -20,6 +20,8 @@
#ifndef __WEECHAT_GUI_COLOR_H
#define __WEECHAT_GUI_COLOR_H 1
#include <regex.h>
/*
* Color from configuration options.
* When changing some colors below:
@ -78,6 +80,7 @@ enum t_gui_color_enum
GUI_COLOR_CHAT_NICK_OFFLINE_HIGHLIGHT,
GUI_COLOR_CHAT_NICK_PREFIX,
GUI_COLOR_CHAT_NICK_SUFFIX,
GUI_COLOR_EMPHASIS,
/* number of colors */
GUI_COLOR_NUM_COLORS,
@ -112,6 +115,7 @@ enum t_gui_color_enum
#define GUI_COLOR_EXTENDED_ITALIC_CHAR '/'
#define GUI_COLOR_EXTENDED_UNDERLINE_CHAR '_'
#define GUI_COLOR_EXTENDED_KEEPATTR_CHAR '|'
#define GUI_COLOR_EMPHASIS_CHAR 'E'
/* color codes specific to bars */
#define GUI_COLOR_BAR_CHAR 'b'
@ -165,6 +169,8 @@ extern int gui_color_attr_get_flag (char c);
extern void gui_color_attr_build_string (int color, char *str_attr);
extern const char *gui_color_get_custom (const char *color_name);
extern char *gui_color_decode (const char *string, const char *replacement);
extern char *gui_color_emphasize (const char *string, const char *search,
int case_sensitive, regex_t *regex);
extern void gui_color_free (struct t_gui_color *color);
extern void gui_color_palette_alloc_structs ();
extern int gui_color_palette_get_alias (const char *alias);

View File

@ -201,8 +201,6 @@ extern int gui_window_get_height ();
extern int gui_window_objects_init (struct t_gui_window *window);
extern void gui_window_objects_free (struct t_gui_window *window,
int free_separators);
extern void gui_window_save_style ();
extern void gui_window_restore_style ();
extern void gui_window_calculate_pos_size (struct t_gui_window *window);
extern void gui_window_switch_to_buffer (struct t_gui_window *window,
struct t_gui_buffer *buffer,