1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

core: add option weechat.look.highlight_disable_regex and buffer property "highlight_disable_regex" (closes #1798)

This commit is contained in:
Sébastien Helleu
2022-07-24 22:29:07 +02:00
parent 1796634d83
commit 68ad24f2df
51 changed files with 860 additions and 112 deletions
+1
View File
@@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
New features::
* core: add option weechat.look.highlight_disable_regex and buffer property "highlight_disable_regex" (issue #1798)
* api: rename function string_build_with_split_string to string_rebuild_split_string, add arguments "index_start" and "index_end"
* api: add info "uptime_current"
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** Werte: beliebige Zeichenkette
** Standardwert: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** Beschreibung: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"]
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette
** Standardwert: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** Beschreibung: pass:none[Suchmuster (erweiterter regulärer POSIX Ausdruck) welches genutzt werden soll, um zu überprüfen ob eine Nachricht ein Highlight enthält oder nicht. Mindestens eine Zeichenkette muss dabei auf das Suchmuster passen (alphanumerisch, "-", "_" oder "|"). Das Suchmuster unterscheidet dabei nicht zwischen Groß-und Kleinschreibung (um zwischen Groß-und Kleinschreibung zu unterscheiden muss am Wortanfang "(?-i)" genutzt werden). Beispiele: "flashcode|flashy", "(?-i)FlashCode|flashy"]
** Typ: Zeichenkette
+33 -2
View File
@@ -2208,6 +2208,37 @@ und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`.
[[highlights]]
=== Highlights
// TRANSLATION MISSING
[[highlights_disable]]
==== Disable highlights
You can disable highlights with option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(regular expression). +
When a highlight is disabled with this option, the other highlight options are
ignored.
For example to disable any highlight on messages with a word beginning
with "flash" between chevrons:
----
/set weechat.look.highlight_regex "<flash.*>"
----
This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
Die Buffer-Eigenschaft "highlight_disable_regex" ist keine permanente Einstellung und wird nicht
in der Konfigurationsdatei gesichert. + Um diese Einstellung persistent zu machen benötigt man
das Skript _buffer_autoset.py_: Um das Skript zu installieren `+/script install buffer_autoset.py+`
und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`.
[[highlights_words]]
==== Worte als Highlights hinzufügen
@@ -2221,7 +2252,7 @@ neben dem eigenen Nick auch die Wörter "Wort1","Wort2" und alle Wörter die mit
"Test" beginnen zu highlighten:
----
/set weechat.look.highlight Wort1,Wort2,Test*
/set weechat.look.highlight "Wort1,Wort2,Test*"
----
Wird eine spezielle Regel benötigt, dann können reguläre Ausdrücke
@@ -2231,7 +2262,7 @@ um zum Beispiel die Wörter "flashcode", "flashcöde" und "flashy"
zu highlighten:
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
Die Trennzeichen die Wörter umschließen können angepasst werden, mit der
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** values: any string
** default value: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** description: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"]
** type: string
** values: any string
** default value: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** description: pass:none[POSIX extended regular expression used to check if a message has highlight or not, at least one match in string must be surrounded by delimiters (chars different from: alphanumeric, "-", "_" and "|"), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "flashcode|flashy", "(?-i)FlashCode|flashy"]
** type: string
+5
View File
@@ -13219,6 +13219,7 @@ Arguments:
** _input_: input text
** _text_search_input_: input saved before text search
** _highlight_words_: list of words to highlight
** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight
** _highlight_regex_: POSIX extended regular expression for highlight
** _highlight_tags_restrict_: restrict highlights to messages with these tags
** _highlight_tags_: force highlight on messages with these tags
@@ -13270,6 +13271,7 @@ Arguments:
* _property_: property name:
** _plugin_: pointer to plugin which created this buffer (NULL for WeeChat main
buffer)
** _highlight_disable_regex_compiled_: regular expression _highlight_disable_regex_ compiled
** _highlight_regex_compiled_: regular expression _highlight_regex_ compiled
Return value:
@@ -13407,6 +13409,9 @@ Properties:
| highlight_words_del | | comma separated list of words
| Comma separated list of words to remove from highlighted words on buffer.
| highlight_disable_regex | | any string
| POSIX extended regular expression for disabling highlight.
| highlight_regex | | any string
| POSIX extended regular expression for highlight.
+2
View File
@@ -691,6 +691,8 @@ inl:
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_disable_regex: None
highlight_disable_regex_compiled: '0x0'
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
+32 -2
View File
@@ -2179,6 +2179,36 @@ with `+/script install buffer_autoset.py+` and get help with
[[highlights]]
=== Highlights
[[highlights_disable]]
==== Disable highlights
You can disable highlights with option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(regular expression). +
When a highlight is disabled with this option, the other highlight options are
ignored.
For example to disable any highlight on messages with a word beginning
with "flash" between chevrons:
----
/set weechat.look.highlight_regex "<flash.*>"
----
This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
The buffer property "highlight_disable_regex" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with
`+/help buffer_autoset+`.
[[highlights_words]]
==== Add words to highlight
@@ -2191,7 +2221,7 @@ You can add other words to highlight with the option
highlight your nick and "word1", "word2" and all words beginning with "test":
----
/set weechat.look.highlight word1,word2,test*
/set weechat.look.highlight "word1,word2,test*"
----
If you need a more specific rule for the word, you can use regular expressions
@@ -2199,7 +2229,7 @@ with the option <<option_weechat.look.highlight_regex,weechat.look.highlight_reg
for example to highlight words "flashcode", "flashcöde" and "flashy":
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
The delimiters around words to highlight can be customized with the option
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** valeurs: toute chaîne
** valeur par défaut: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** description: pass:none[expression régulière POSIX étendue utilisée pour empêcher un highlight sur un message : cette option a une priorité plus élevée sur les autres options de highlight (si la chaîne est trouvée dans le message, le highlight est désactivé et les autres options sont ignorées), l'expression régulière est insensible à la casse (utilisez "(?-i)" au début pour la rendre sensible à la casse), exemples : "<flash.*>", "(?-i)<Flash.*>"]
** type: chaîne
** valeurs: toute chaîne
** valeur par défaut: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** description: pass:none[expression régulière POSIX étendue utilisée pour vérifier si un message a un "highlight" ou non, au moins une correspondance dans la chaîne doit être entourée de délimiteurs (caractères différents de : alphanumérique, "-", "_" et "|"), l'expression régulière est insensible à la casse (utilisez "(?-i)" au début pour la rendre sensible à la casse), exemples : "flashcode|flashy", "(?-i)FlashCode|flashy"]
** type: chaîne
+6
View File
@@ -13502,6 +13502,8 @@ Paramètres :
** _input_ : texte saisi
** _text_search_input_ : texte saisi sauvegardé avant la recherche de texte
** _highlight_words_ : liste des mots pour le highlight
** _highlight_disable_regex_ : expression régulière POSIX étendue pour désactiver
le highlight
** _highlight_regex_ : expression régulière POSIX étendue pour le highlight
** _highlight_tags_restrict_ : restreindre les highlights aux messages
comportant ces étiquettes
@@ -13555,6 +13557,7 @@ Paramètres :
* _property_ : nom de la propriété :
** _plugin_ : pointeur vers l'extension qui a créé le tampon (NULL pour le
tampon principal WeeChat)
** _highlight_disable_regex_compiled_ : expression régulière _highlight_disable_regex_ compilée
** _highlight_regex_compiled_ : expression régulière _highlight_regex_ compilée
Valeur de retour :
@@ -13700,6 +13703,9 @@ Propriétés :
| Liste de mots à supprimer de la liste des mots à mettre en valeur dans ce
tampon.
| highlight_disable_regex | | any string
| Expression régulière POSIX étendue pour désactiver le highlight.
| highlight_regex | | toute chaîne
| Expression régulière POSIX étendue pour le highlight.
+2
View File
@@ -704,6 +704,8 @@ inl:
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_disable_regex: None
highlight_disable_regex_compiled: '0x0'
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
+34 -2
View File
@@ -2240,6 +2240,38 @@ avec `+/help buffer_autoset+`.
[[highlights]]
=== Highlights
// TRANSLATION MISSING
[[highlights_disable]]
==== Désactiver les highlights
Vous pouvez désactiver les highlights avec l'option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(expression régulière). +
Lorsqu'un highlight est désactivé avec cette option, les autres options de
highlight sont ignorées.
Par exemple pour désactiver tout highlight sur les messages avec un mot
commençant par "flash" entre chevrons :
----
/set weechat.look.highlight_regex "<flash.*>"
----
Ceci peut aussi être défini avec la propriété de tampon "highlight_disable_regex".
Même exemple, spécifique au tampon courant :
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
La propriété de tampon "highlight_disable_regex" n'est pas sauvegardée dans la
configuration. +
Vous pouvez facilement la sauvegarder avec le script _buffer_autoset.py_ : vous
pouvez l'installer avec `+/script install buffer_autoset.py+` et obtenir de l'aide
avec `+/help buffer_autoset+`.
[[highlights_words]]
==== Ajouter des mots pour le « highlight »
@@ -2252,7 +2284,7 @@ Vous pouvez ajouter d'autres mots à mettre en valeur avec l'option
en valeur votre pseudo, "mot1", "mot2" et tous les mots commençants par "test" :
----
/set weechat.look.highlight mot1,mot2,test*
/set weechat.look.highlight "mot1,mot2,test*"
----
Si vous avez besoin d'une règle plus spécifique pour un mot, vous pouvez utiliser
@@ -2261,7 +2293,7 @@ des expressions régulières avec l'option
par exemple pour mettre en valeur les mots "flashcode", "flashcöde" et "flashy" :
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
Les délimiteurs autour des mots à mettre en valeur peuvent être paramétrés avec
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** valori: qualsiasi stringa
** valore predefinito: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** descrizione: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"]
** tipo: stringa
** valori: qualsiasi stringa
** valore predefinito: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** descrizione: pass:none[POSIX extended regular expression used to check if a message has highlight or not, at least one match in string must be surrounded by delimiters (chars different from: alphanumeric, "-", "_" and "|"), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "flashcode|flashy", "(?-i)FlashCode|flashy"]
** tipo: stringa
+7
View File
@@ -13785,6 +13785,8 @@ Argomenti:
** _text_search_input_: input salvato prima della ricerca nel testo
** _highlight_words_: elenco di parole da evidenziare
// TRANSLATION MISSING
** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight
// TRANSLATION MISSING
** _highlight_regex_: POSIX extended regular expression for highlight
// TRANSLATION MISSING
** _highlight_tags_restrict_: restrict highlights to messages with these tags
@@ -13838,6 +13840,7 @@ Argomenti:
* _property_: nome proprietà:
** _plugin_: puntatore al plugin che ha creato questo buffer (NULL
per il buffer principale di WeeChat)
** _highlight_disable_regex_compiled_: espressione regolare _highlight_disable_regex_ compilata
** _highlight_regex_compiled_: espressione regolare _highlight_regex_ compilata
Valore restituito:
@@ -13995,6 +13998,10 @@ Properties:
| Elenco di parole separate da virgole da rimuovere dalle
parole evidenziate nel buffer.
// TRANSLATION MISSING
| highlight_disable_regex | | any string
| POSIX extended regular expression for disabling highlight.
// TRANSLATION MISSING
| highlight_regex | | qualsiasi stringa
| POSIX extended regular expression for highlight.
+33 -2
View File
@@ -2393,6 +2393,37 @@ with `+/script install buffer_autoset.py+` and get help with `+/help buffer_auto
[[highlights]]
=== Highlights
// TRANSLATION MISSING
[[highlights_disable]]
==== Disable highlights
You can disable highlights with option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(regular expression). +
When a highlight is disabled with this option, the other highlight options are
ignored.
For example to disable any highlight on messages with a word beginning
with "flash" between chevrons:
----
/set weechat.look.highlight_regex "<flash.*>"
----
This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
The buffer property "highlight_disable_regex" is not saved in configuration. +
You can easily save it with the script _buffer_autoset.py_: you can install it
with `+/script install buffer_autoset.py+` and get help with
`+/help buffer_autoset+`.
[[highlights_words]]
==== Add words to highlight
@@ -2405,7 +2436,7 @@ You can add other words to highlight with the option
highlight your nick and "word1", "word2" and all words beginning with "test":
----
/set weechat.look.highlight word1,word2,test*
/set weechat.look.highlight "word1,word2,test*"
----
If you need a more specific rule for the word, you can use regular expressions
@@ -2413,7 +2444,7 @@ with the option <<option_weechat.look.highlight_regex,weechat.look.highlight_reg
for example to highlight words "flashcode", "flashcöde" and "flashy":
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
The delimiters around words to highlight can be customized with the option
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** 値: 未制約文字列
** デフォルト値: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** 説明: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"]
** タイプ: 文字列
** 値: 未制約文字列
** デフォルト値: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** 説明: pass:none[メッセージ中のハイライトの有無を判断する POSIX 拡張正規表現、マッチ部分は必ず区切り文字 (アルファベット、"-"、"_"、"|" 以外の文字) で囲まれていなければいけない、正規表現は大文字小文字を区別しない (最初に "(?-i)" がある場合は区別する)、例: "flashcode|flashy"、"(?-i)FlashCode|flashy"]
** タイプ: 文字列
+7
View File
@@ -13291,6 +13291,8 @@ const char *weechat_buffer_get_string (struct t_gui_buffer *buffer,
** _input_: 入力テキスト
** _text_search_input_: テキスト検索前に保存した入力テキスト
** _highlight_words_: ハイライトする単語のリスト
// TRANSLATION MISSING
** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight
** _highlight_regex_: ハイライト用の POSIX 拡張正規表現
** _highlight_tags_restrict_: これらのタグを付けられたメッセージだけにハイライトを制限する
** _highlight_tags_: これらのタグを付けられたメッセージを強制的にハイライトする
@@ -13342,6 +13344,7 @@ void *weechat_buffer_pointer (struct t_gui_buffer *buffer,
* _property_: プロパティ名:
** _plugin_: このバッファを作ったプラグインへのポインタ
(WeeChat メインバッファの場合は NULL)
** _highlight_disable_regex_compiled_: コンパイル済みの正規表現 _highlight_disable_regex_
** _highlight_regex_compiled_: コンパイル済みの正規表現 _highlight_regex_
戻り値:
@@ -13479,6 +13482,10 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property,
| highlight_words_del | | 単語のコンマ区切りリスト
| 指定したバッファ内でハイライトする単語から削除する単語のコンマ区切りリスト
// TRANSLATION MISSING
| highlight_disable_regex | | any string
| POSIX extended regular expression for disabling highlight.
| highlight_regex | | 任意の文字列
| ハイライトする POSIX 拡張正規表現
+2
View File
@@ -710,6 +710,8 @@ inl:
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_disable_regex: None
highlight_disable_regex_compiled: '0x0'
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
+32 -2
View File
@@ -2293,6 +2293,36 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す
[[highlights]]
=== ハイライト
// TRANSLATION MISSING
[[highlights_disable]]
==== Disable highlights
You can disable highlights with option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(regular expression). +
When a highlight is disabled with this option, the other highlight options are
ignored.
For example to disable any highlight on messages with a word beginning
with "flash" between chevrons:
----
/set weechat.look.highlight_regex "<flash.*>"
----
This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
バッファプロパティ "highlight_disable_regex" は設定ファイルに保存されません。 +
これを保存するには _buffer_autoset.py_ スクリプトを使ってください: このスクリプトをインストールするには
`+/script install buffer_autoset.py+` コマンドを使い、ヘルプを見るには `+/help buffer_autoset+` コマンドを使ってください。
[[highlights_words]]
==== ハイライトする単語の追加
@@ -2305,7 +2335,7 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す
から始まる任意の単語をハイライトするには以下のように設定します:
----
/set weechat.look.highlight word1,word2,test*
/set weechat.look.highlight "word1,word2,test*"
----
単語に対してさらに具体的なルールを設定する必要がある場合、<<option_weechat.look.highlight_regex,weechat.look.highlight_regex>>
@@ -2313,7 +2343,7 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す
という単語をハイライトするには以下のように設定します:
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
ハイライトする単語の区切りは <<option_weechat.look.word_chars_highlight,weechat.look.word_chars_highlight>>
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** wartości: dowolny ciąg
** domyślna wartość: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** opis: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"]
** typ: ciąg
** wartości: dowolny ciąg
** domyślna wartość: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** opis: pass:none[Rozszerzone wyrażenie regularne POSIX używane do sprawdzenia, czy wiadomość posiada podświetlenie czy nie, przynajmniej jedno dopasowanie w ciąg musi być otoczone separatorami (znaki inne niż: alfanumeryczne, "-", "_" lub "|"), wielkość znaków nie ma wpływu na wyrażenie (użyj "(?-i)" na początku, aby wielkość znaków miała znaczenie), przykłady: "flashcode|flashy", "(?-i)FlashCode|flashy"]
** typ: ciąg
+32 -2
View File
@@ -2208,6 +2208,36 @@ Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalowa
[[highlights]]
=== Podświetlenia
// TRANSLATION MISSING
[[highlights_disable]]
==== Disable highlights
You can disable highlights with option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(regular expression). +
When a highlight is disabled with this option, the other highlight options are
ignored.
For example to disable any highlight on messages with a word beginning
with "flash" between chevrons:
----
/set weechat.look.highlight_regex "<flash.*>"
----
This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
Właściwość bufora "highlight_disable_regex" nie jest zapisywana w konfiguracji. +
Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalować za pomocą
`+/script install buffer_autoset.py+`, informacje o używaniu `+/help buffer_autoset+`.
[[highlights_words]]
==== Dodawanie słów do podświetleń
@@ -2219,7 +2249,7 @@ Możesz dodawać inne słowa do podświetlen używając opcji
podświetlać Twój nick oraz słowa "słowo1", "słowo2" oraz wszystko co zaczyna się od "test":
----
/set weechat.look.highlight słowo1,słowo2,test*
/set weechat.look.highlight "słowo1,słowo2,test*"
----
Jeżeli potrzebujesz bardziej przecyzyjnej reguły, możesz użyć wyrażenia reglarnego
@@ -2227,7 +2257,7 @@ używając opcji <<option_weechat.look.highlight_regex,weechat.look.highlight_re
na przydład do podświetlania słów "flashcode", "flashcöde" i "flashy":
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
Separatory do okoła podświetlanych słów można zmienić za pomocą opcji
@@ -631,6 +631,8 @@ _text_search_input_   (string) +
_highlight_words_   (string) +
_highlight_regex_   (string) +
_highlight_regex_compiled_   (pointer) +
_highlight_disable_regex_   (string) +
_highlight_disable_regex_compiled_   (pointer) +
_highlight_tags_restrict_   (string) +
_highlight_tags_restrict_count_   (integer) +
_highlight_tags_restrict_array_   (pointer, array_size: "highlight_tags_restrict_count") +
@@ -750,6 +750,12 @@
** вредности: било који стринг
** подразумевана вредност: `+""+`
* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex*
** опис: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"]
** тип: стринг
** вредности: било који стринг
** подразумевана вредност: `+""+`
* [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex*
** опис: pass:none[POSIX проширени регуларни израз који се користи за проверу да ли порука садржи истицање или не, барем једно подударање мора бити окружено граничницима (карактери који се разликују од: алфанумерика, „-”, „_” и „|”), регуларни израз не прави разлику у величини слова (употребите „(?-i)” не почетку ако желите да се величина слова узима у обзир), примери: „flashcode|flashy”, „(?-i)FlashCode|flashy”]
** тип: стринг
+7
View File
@@ -12736,6 +12736,8 @@ const char *weechat_buffer_get_string (struct t_gui_buffer *buffer,
** _input_: текст уноса
** _text_search_input_: сачувани унос пре претраге текста
** _highlight_words_: листа речи које се истичу
// TRANSLATION MISSING
** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight
** _highlight_regex_: POSIX проширени регуларни израз за истицање
** _highlight_tags_restrict_: ограничава истицање само на поруке са наведеним ознакама
** _highlight_tags_: истицање се форсира за поруке са наведеним ознакама
@@ -12785,6 +12787,7 @@ void *weechat_buffer_pointer (struct t_gui_buffer *buffer,
* _buffer_: показивач на бафер
* _property_: име особине:
** _plugin_: показивач на додатак који је креирао овај бафер (NULL за главни бафер програма WeeChat)
** _highlight_disable_regex_compiled_: компајлиран регуларни израз _highlight_disable_regex_
** _highlight_regex_compiled_: компајлиран регуларни израз _highlight_regex_
Повратна вредност:
@@ -12923,6 +12926,10 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property,
| highlight_words_del | | листа речи раздвојених запетама
| Лист речи раздвојених запетама које треба да се уклоне из речи које се истичу у овом баферу.
// TRANSLATION MISSING
| highlight_disable_regex | | any string
| POSIX extended regular expression for disabling highlight.
| highlight_regex | | било који стринг
| POSIX проширени регуларни израз за истицање.
+2
View File
@@ -640,6 +640,8 @@ inl:
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_disable_regex: None
highlight_disable_regex_compiled: '0x0'
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
+31 -2
View File
@@ -2061,6 +2061,35 @@ include::includes/autogen_user_options.sr.adoc[tag=charset_options]
[[highlights]]
=== Истицања
// TRANSLATION MISSING
[[highlights_disable]]
==== Disable highlights
You can disable highlights with option
<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>>
(regular expression). +
When a highlight is disabled with this option, the other highlight options are
ignored.
For example to disable any highlight on messages with a word beginning
with "flash" between chevrons:
----
/set weechat.look.highlight_regex "<flash.*>"
----
This can also be set with the buffer property "highlight_disable_regex".
Same example, specific to the current buffer:
----
/buffer set highlight_disable_regex <flash.*>
----
[NOTE]
Особина бафера „highlight_disable_regex” се не чува у конфигурацији. +
Лако можете да је сачувате скриптом _buffer_autoset.py_: инсталирате је командом `+/script install buffer_autoset.py+`, а помоћ добијате са `+/help buffer_autoset+`.
[[highlights_words]]
==== Додавање речи које се истичу
@@ -2069,13 +2098,13 @@ include::includes/autogen_user_options.sr.adoc[tag=charset_options]
Остале речи моожете да додате опцијом <<option_weechat.look.highlight,weechat.look.highlight>>, на пример ако желите да се истиче ваш надимак и „реч1”, „реч2”, као и све речи које почињу са „test”:
----
/set weechat.look.highlight реч1,реч2,test*
/set weechat.look.highlight "реч1,реч2,test*"
----
Ако вам је потребно одређеније правило за реч, можете да употребите регуларне изразе опцијом <<option_weechat.look.highlight_regex,weechat.look.highlight_regex>>, на пример да истакнете речи „flashcode”, „flashcöde” и „flashy”:
----
/set weechat.look.highlight_regex flashc[oö]de|flashy
/set weechat.look.highlight_regex "flashc[oö]de|flashy"
----
Граничници око речи које се истичу могу да се прилагоде опцијом <<option_weechat.look.word_chars_highlight,weechat.look.word_chars_highlight>>.
+24 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-18 16:11+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3344,6 +3344,29 @@ 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 ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"POSIX rozšířené regulární výrazy používané k kontrole jestli má být zpráva "
"zvýrazněna nebo ne, alespoň jedno nalezení v řetězci musí být obklopeno "
"oddělovači (jiné znaky než: alfanumerické, \"-\", \"_\" a \"|\"), regulární "
"výraz není citlivý na velikost znaků (zkus \"(?-i)\" na začátku k přepnutí "
"na rozeznávání dle velikosti), například: \"flashcode|flashy\", \"(?-"
"i)FlashCode|flashy\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+25 -1
View File
@@ -25,7 +25,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-20 13:39+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -4245,6 +4245,30 @@ msgstr ""
"werden). Schlagwörter können mit \"*\", als Joker, beginnen oder enden; "
"Beispiel: \"test,(?-i)*toto*,flash*\""
#, fuzzy
#| msgid ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"Suchmuster (erweiterter regulärer POSIX Ausdruck) welches genutzt werden "
"soll, um zu überprüfen ob eine Nachricht ein Highlight enthält oder nicht. "
"Mindestens eine Zeichenkette muss dabei auf das Suchmuster passen "
"(alphanumerisch, \"-\", \"_\" oder \"|\"). Das Suchmuster unterscheidet "
"dabei nicht zwischen Groß-und Kleinschreibung (um zwischen Groß-und "
"Kleinschreibung zu unterscheiden muss am Wortanfang \"(?-i)\" genutzt "
"werden). Beispiele: \"flashcode|flashy\", \"(?-i)FlashCode|flashy\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+16 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-18 16:11+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3846,6 +3846,21 @@ msgstr ""
"sensible), las palabras pueden empezar o terminar con \"*\" para una "
"concordancia parcial; ejemplo: \"prueba,(?-i)*toto*,flash*\""
#, fuzzy
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"expresión regular usada para ver si un mensaje tiene un resalte o no, al "
"menos una coincidencia en el texto debe estar rodeado por letras "
"(alfanumérico, \"-\", \"_\" o \"|\"), la expresión regular es insensible a "
"las mayúsculas (usa \"(?-i)\" al principio para cambiarlo), ejemplos: "
"\"FlashCode|flashy\", \"(?-i)Flascode|flashy\""
#, fuzzy
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
+17 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-07-10 12:32+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-07-24 22:19+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -4132,6 +4132,21 @@ msgstr ""
"terminer par \"*\" pour une comparaison partielle ; exemple : \"test,(?-"
"i)*toto*,flash*\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"expression régulière POSIX étendue utilisée pour empêcher un highlight sur "
"un message : cette option a une priorité plus élevée sur les autres options "
"de highlight (si la chaîne est trouvée dans le message, le highlight est "
"désactivé et les autres options sont ignorées), l'expression régulière est "
"insensible à la casse (utilisez \"(?-i)\" au début pour la rendre sensible à "
"la casse), exemples : \"<flash.*>\", \"(?-i)<Flash.*>\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+10 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2986,6 +2986,15 @@ 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 ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+17 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3539,6 +3539,22 @@ msgstr ""
"sensibili alle maiuscole), le parole possono iniziare o terminare con \"*\" "
"per la corrispondenza parziale; ad esempio: \"test,(?-i)*tizio*,flash*\""
#, fuzzy
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"espressione regolare usata per verificare se un messaggio contiene una "
"notifica oppure no, almeno una corrispondenza nella stringa deve essere "
"racchiusa da caratteri :(alfanumerici, \"-\", \"_\" or \"|\"), l'espressione "
"regolare non è sensibile alle maiuscole (usare \"(?-i)\" all'inizio per "
"renderla sensibile alle maiuscole), ad esempio: \"flashcode|flashy\", \"(?-"
"i)Flashcode|flashy\""
#, fuzzy
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
+22 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -3976,6 +3976,27 @@ msgstr ""
"に \"(?-i)\" をつければ区別有り)、部分マッチさせるには単語の最初か最後に "
"\"*\" をつける; 例: \"test,(?-i)*toto*,flash*\""
#, fuzzy
#| msgid ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"メッセージ中のハイライトの有無を判断する POSIX 拡張正規表現、マッチ部分は必ず"
"区切り文字 (アルファベット、\"-\"、\"_\"、\"|\" 以外の文字) で囲まれていなけ"
"ればいけない、正規表現は大文字小文字を区別しない (最初に \"(?-i)\" がある場合"
"は区別する)、例: \"flashcode|flashy\"、\"(?-i)FlashCode|flashy\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+24 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -4200,6 +4200,29 @@ msgstr ""
"znaków miała znaczenie), słowa mogą zaczynać się od \"*\" dla częściowego "
"dopasowania; przykład: \"test,(?-i)*toto*,flash*\""
#, fuzzy
#| msgid ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"Rozszerzone wyrażenie regularne POSIX używane do sprawdzenia, czy wiadomość "
"posiada podświetlenie czy nie, przynajmniej jedno dopasowanie w ciąg musi "
"być otoczone separatorami (znaki inne niż: alfanumeryczne, \"-\", \"_\" lub "
"\"|\"), wielkość znaków nie ma wpływu na wyrażenie (użyj \"(?-i)\" na "
"początku, aby wielkość znaków miała znaczenie), przykłady: \"flashcode|"
"flashy\", \"(?-i)FlashCode|flashy\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+24 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -3980,6 +3980,29 @@ msgstr ""
"distinguir), as palavras podem começar ou terminar por \"*\" para "
"corresponder parcialmente; exemplo: \"teste,(?-i)*toto*,flash*\""
#, fuzzy
#| msgid ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"expressão regular POSIX estendida utilizada para verificar se a mensagem tem "
"um realce ou não, pelo menos uma correspondência deve estar entre "
"delimitadores (carateres diferentes de: alfanumérico, \"-\", \"_\" e \"|\"), "
"a expressão regular distingue maiúsculas e minúsculas (use \"(?-i)\" no "
"início para distinguir), exemplos: \"flashcode|flashy\", \"(?-i)FlashCode|"
"flash\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+15 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3584,6 +3584,20 @@ msgstr ""
"levar em conta maiúscula/minúscula, palavras podem começar ou terminar com "
"\"*\" para coincidências parciais)"
#, fuzzy
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"expressão regular usada para verificar se a mensagem tem destaque ou não, "
"pelo menos uma correspondência na string precisa ser envolta por caracteres "
"de palavra (alfanumérico, \"-\", \"_\" ou \"|\"), expressões regulares levam "
"em conta maiúscula/minúscula, exemplo: \"FlashCode|flashy\""
#, fuzzy
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
+10 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3011,6 +3011,15 @@ msgstr ""
"разделённый запятыми список подсвечиваемых слов (регистр учитывается, слова "
"могут начинаться или кончаться \"*\" для неполного соответствия)"
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+24 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-07-06 08:29+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4051,6 +4051,29 @@ msgstr ""
"слова узима у обзир), речи могу да почну или да се заврше са „*” чиме се "
"добија делимично подударање; пример: „test,(?-i)*toto*,flash*”"
#, fuzzy
#| msgid ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"POSIX проширени регуларни израз који се користи за проверу да ли порука "
"садржи истицање или не, барем једно подударање мора бити окружено "
"граничницима (карактери који се разликују од: алфанумерика, „-”, „_” и „|”), "
"регуларни израз не прави разлику у величини слова (употребите „(?-i)” не "
"почетку ако желите да се величина слова узима у обзир), примери: „flashcode|"
"flashy”, „(?-i)FlashCode|flashy”"
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+24 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2022-06-18 16:13+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4126,6 +4126,29 @@ msgstr ""
"kullanın), kısmi eşleşme için sözcükler \"*\" ile başlayabilir; örnek: "
"\"test,(?-i)*toto*,flash*\""
#, fuzzy
#| msgid ""
#| "POSIX extended regular expression used to check if a message has "
#| "highlight or not, at least one match in string must be surrounded by "
#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), "
#| "regular expression is case insensitive (use \"(?-i)\" at beginning to "
#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|"
#| "flashy\""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
"bir iletinin vurgulaması olup olmadığını denetlemek için POSIX genişletilmiş "
"düzenli ifadeleri kullanılır, en azından dizideki bir eşleşme "
"sınırlandırıcılarla çevrilmiş olmalıdır (şunlardan farklı karakterler: abece "
"ve sayılar, \"-\", \"_\" ve \"|\"), düzenli ifadeler BÜYÜK/küçük harf "
"duyarsızdır (duyarlı yapmak için sözcüklerin başında \"(?-i)\" kullanın), "
"örnekler: \"flaşkodu|flaşlı\", \"(?-i)FlaşKodu|Flaşlı\""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+10 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"POT-Creation-Date: 2022-07-24 22:18+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2735,6 +2735,15 @@ msgid ""
"flash*\""
msgstr ""
msgid ""
"POSIX extended regular expression used to prevent any highlight from a "
"message: this option has higher priority over other highlight options (if "
"the string is found in the message, the highlight is disabled and the other "
"options are ignored), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-"
"i)<Flash.*>\""
msgstr ""
msgid ""
"POSIX extended regular expression used to check if a message has highlight "
"or not, at least one match in string must be surrounded by delimiters (chars "
+62
View File
@@ -121,6 +121,7 @@ struct t_config_option *config_look_day_change_message_2dates;
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_disable_regex;
struct t_config_option *config_look_highlight_regex;
struct t_config_option *config_look_highlight_tags;
struct t_config_option *config_look_hotlist_add_conditions;
@@ -321,6 +322,7 @@ int config_length_prefix_same_nick_middle = 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_disable_regex = NULL;
regex_t *config_highlight_regex = NULL;
char ***config_highlight_tags = NULL;
int config_num_highlight_tags = 0;
@@ -912,6 +914,43 @@ config_change_emphasized_attributes (const void *pointer, void *data,
gui_window_ask_refresh (1);
}
/*
* Callback for changes on option "weechat.look.highlight_disable_regex".
*/
void
config_change_highlight_disable_regex (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) option;
if (config_highlight_disable_regex)
{
regfree (config_highlight_disable_regex);
free (config_highlight_disable_regex);
config_highlight_disable_regex = NULL;
}
if (CONFIG_STRING(config_look_highlight_disable_regex)
&& CONFIG_STRING(config_look_highlight_disable_regex)[0])
{
config_highlight_disable_regex = malloc (sizeof (*config_highlight_disable_regex));
if (config_highlight_disable_regex)
{
if (string_regcomp (config_highlight_disable_regex,
CONFIG_STRING(config_look_highlight_disable_regex),
REG_EXTENDED | REG_ICASE) != 0)
{
free (config_highlight_disable_regex);
config_highlight_disable_regex = NULL;
}
}
}
}
/*
* Callback for changes on option "weechat.look.highlight_regex".
*/
@@ -3035,6 +3074,20 @@ config_weechat_init_options ()
"example: \"test,(?-i)*toto*,flash*\""),
NULL, 0, 0, "", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_highlight_disable_regex = config_file_new_option (
weechat_config_file, ptr_section,
"highlight_disable_regex", "string",
N_("POSIX extended regular expression used to prevent any highlight "
"from a message: this option has higher priority over other "
"highlight options (if the string is found in the message, the "
"highlight is disabled and the other options are ignored), "
"regular expression is case insensitive (use \"(?-i)\" at beginning "
"to make it case sensitive), examples: "
"\"<flash.*>\", \"(?-i)<Flash.*>\""),
NULL, 0, 0, "", NULL, 0,
NULL, NULL, NULL,
&config_change_highlight_disable_regex, NULL, NULL,
NULL, NULL, NULL);
config_look_highlight_regex = config_file_new_option (
weechat_config_file, ptr_section,
"highlight_regex", "string",
@@ -4876,6 +4929,8 @@ config_weechat_init ()
&config_day_change_timer_cb,
NULL, NULL);
}
if (!config_highlight_disable_regex)
config_change_highlight_disable_regex (NULL, NULL, NULL);
if (!config_highlight_regex)
config_change_highlight_regex (NULL, NULL, NULL);
if (!config_highlight_tags)
@@ -4937,6 +4992,13 @@ config_weechat_free ()
{
config_file_free (weechat_config_file);
if (config_highlight_disable_regex)
{
regfree (config_highlight_disable_regex);
free (config_highlight_disable_regex);
config_highlight_disable_regex = NULL;
}
if (config_highlight_regex)
{
regfree (config_highlight_regex);
+2
View File
@@ -173,6 +173,7 @@ extern struct t_config_option *config_look_day_change_message_2dates;
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_disable_regex;
extern struct t_config_option *config_look_highlight_regex;
extern struct t_config_option *config_look_highlight_tags;
extern struct t_config_option *config_look_hotlist_add_conditions;
@@ -357,6 +358,7 @@ extern int config_length_nick_prefix_suffix;
extern int config_length_prefix_same_nick;
extern int config_length_prefix_same_nick_middle;
extern int config_emphasized_attributes;
extern regex_t *config_highlight_disable_regex;
extern regex_t *config_highlight_regex;
extern char ***config_highlight_tags;
extern int config_num_highlight_tags;
+2
View File
@@ -557,6 +557,8 @@ upgrade_weechat_read_buffer (struct t_infolist *infolist)
/* highlight options */
gui_buffer_set_highlight_words (
ptr_buffer, infolist_string (infolist, "highlight_words"));
gui_buffer_set_highlight_disable_regex (
ptr_buffer, infolist_string (infolist, "highlight_disable_regex"));
gui_buffer_set_highlight_regex (
ptr_buffer, infolist_string (infolist, "highlight_regex"));
if (infolist_search_var (infolist,
+99 -27
View File
@@ -106,12 +106,14 @@ char *gui_buffer_properties_get_integer[] =
};
char *gui_buffer_properties_get_string[] =
{ "plugin", "name", "full_name", "old_full_name", "short_name", "title",
"input", "text_search_input", "highlight_words", "highlight_regex",
"highlight_tags_restrict", "highlight_tags", "hotlist_max_level_nicks",
"input", "text_search_input", "highlight_words", "highlight_disable_regex",
"highlight_regex", "highlight_tags_restrict", "highlight_tags",
"hotlist_max_level_nicks",
NULL
};
char *gui_buffer_properties_get_pointer[] =
{ "plugin", "text_search_regex_compiled", "highlight_regex_compiled",
{ "plugin", "text_search_regex_compiled", "highlight_disable_regex_compiled",
"highlight_regex_compiled",
NULL
};
char *gui_buffer_properties_set[] =
@@ -119,10 +121,11 @@ char *gui_buffer_properties_set[] =
"clear", "filter", "number", "name", "short_name", "type", "notify", "title",
"time_for_each_line", "nicklist", "nicklist_case_sensitive",
"nicklist_display_groups", "highlight_words", "highlight_words_add",
"highlight_words_del", "highlight_regex", "highlight_tags_restrict",
"highlight_tags", "hotlist_max_level_nicks", "hotlist_max_level_nicks_add",
"hotlist_max_level_nicks_del", "input", "input_pos",
"input_get_unknown_commands", "input_get_empty", "input_multiline",
"highlight_words_del", "highlight_disable_regex", "highlight_regex",
"highlight_tags_restrict", "highlight_tags", "hotlist_max_level_nicks",
"hotlist_max_level_nicks_add", "hotlist_max_level_nicks_del",
"input", "input_pos", "input_get_unknown_commands", "input_get_empty",
"input_multiline",
NULL
};
@@ -800,6 +803,8 @@ gui_buffer_new_props (struct t_weechat_plugin *plugin,
/* highlight */
new_buffer->highlight_words = NULL;
new_buffer->highlight_disable_regex = NULL;
new_buffer->highlight_disable_regex_compiled = NULL;
new_buffer->highlight_regex = NULL;
new_buffer->highlight_regex_compiled = NULL;
new_buffer->highlight_tags_restrict = NULL;
@@ -1310,6 +1315,8 @@ gui_buffer_get_string (struct t_gui_buffer *buffer, const char *property)
return buffer->text_search_input;
else if (string_strcasecmp (property, "highlight_words") == 0)
return buffer->highlight_words;
else if (string_strcasecmp (property, "highlight_disable_regex") == 0)
return buffer->highlight_disable_regex;
else if (string_strcasecmp (property, "highlight_regex") == 0)
return buffer->highlight_regex;
else if (string_strcasecmp (property, "highlight_tags_restrict") == 0)
@@ -1343,6 +1350,8 @@ gui_buffer_get_pointer (struct t_gui_buffer *buffer, const char *property)
return buffer->plugin;
else if (string_strcasecmp (property, "text_search_regex_compiled") == 0)
return buffer->text_search_regex_compiled;
else if (string_strcasecmp (property, "highlight_disable_regex_compiled") == 0)
return buffer->highlight_disable_regex_compiled;
else if (string_strcasecmp (property, "highlight_regex_compiled") == 0)
return buffer->highlight_regex_compiled;
@@ -1737,13 +1746,57 @@ gui_buffer_remove_highlight_words (struct t_gui_buffer *buffer,
string_free_split (remove_words);
}
/*
* Sets highlight disable regex for a buffer.
*/
void
gui_buffer_set_highlight_disable_regex (struct t_gui_buffer *buffer,
const char *new_regex)
{
if (!buffer)
return;
if (buffer->highlight_disable_regex)
{
free (buffer->highlight_disable_regex);
buffer->highlight_disable_regex = NULL;
}
if (buffer->highlight_disable_regex_compiled)
{
regfree (buffer->highlight_disable_regex_compiled);
free (buffer->highlight_disable_regex_compiled);
buffer->highlight_disable_regex_compiled = NULL;
}
if (new_regex && new_regex[0])
{
buffer->highlight_disable_regex = strdup (new_regex);
if (buffer->highlight_disable_regex)
{
buffer->highlight_disable_regex_compiled =
malloc (sizeof (*buffer->highlight_disable_regex_compiled));
if (buffer->highlight_disable_regex_compiled)
{
if (string_regcomp (buffer->highlight_disable_regex_compiled,
buffer->highlight_disable_regex,
REG_EXTENDED | REG_ICASE) != 0)
{
free (buffer->highlight_disable_regex_compiled);
buffer->highlight_disable_regex_compiled = NULL;
}
}
}
}
}
/*
* Sets highlight regex for a buffer.
*/
void
gui_buffer_set_highlight_regex (struct t_gui_buffer *buffer,
const char *new_highlight_regex)
const char *new_regex)
{
if (!buffer)
return;
@@ -1760,9 +1813,9 @@ gui_buffer_set_highlight_regex (struct t_gui_buffer *buffer,
buffer->highlight_regex_compiled = NULL;
}
if (new_highlight_regex && new_highlight_regex[0])
if (new_regex && new_regex[0])
{
buffer->highlight_regex = strdup (new_highlight_regex);
buffer->highlight_regex = strdup (new_regex);
if (buffer->highlight_regex)
{
buffer->highlight_regex_compiled =
@@ -2234,6 +2287,10 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
{
gui_buffer_remove_highlight_words (buffer, value);
}
else if (string_strcasecmp (property, "highlight_disable_regex") == 0)
{
gui_buffer_set_highlight_disable_regex (buffer, value);
}
else if (string_strcasecmp (property, "highlight_regex") == 0)
{
gui_buffer_set_highlight_regex (buffer, value);
@@ -3034,6 +3091,13 @@ gui_buffer_close (struct t_gui_buffer *buffer)
}
if (buffer->highlight_words)
free (buffer->highlight_words);
if (buffer->highlight_disable_regex)
free (buffer->highlight_disable_regex);
if (buffer->highlight_disable_regex_compiled)
{
regfree (buffer->highlight_disable_regex_compiled);
free (buffer->highlight_disable_regex_compiled);
}
if (buffer->highlight_regex)
free (buffer->highlight_regex);
if (buffer->highlight_regex_compiled)
@@ -4430,6 +4494,8 @@ gui_buffer_hdata_buffer_cb (const void *pointer, void *data,
HDATA_VAR(struct t_gui_buffer, text_search_found, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, text_search_input, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, highlight_words, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, highlight_disable_regex, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, highlight_disable_regex_compiled, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, highlight_regex, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, highlight_regex_compiled, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, highlight_tags_restrict, STRING, 0, NULL, NULL);
@@ -4642,6 +4708,10 @@ gui_buffer_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!infolist_new_var_string (ptr_item, "highlight_words", buffer->highlight_words))
return 0;
if (!infolist_new_var_string (ptr_item, "highlight_disable_regex", buffer->highlight_disable_regex))
return 0;
if (!infolist_new_var_pointer (ptr_item, "highlight_disable_regex_compiled", buffer->highlight_disable_regex_compiled))
return 0;
if (!infolist_new_var_string (ptr_item, "highlight_regex", buffer->highlight_regex))
return 0;
if (!infolist_new_var_pointer (ptr_item, "highlight_regex_compiled", buffer->highlight_regex_compiled))
@@ -4851,27 +4921,29 @@ gui_buffer_print_log ()
num, ptr_undo, ptr_undo->data, ptr_undo->pos);
num++;
}
log_printf (" completion. . . . . . . : 0x%lx", ptr_buffer->completion);
log_printf (" completion. . . . . . . . . . . : 0x%lx", ptr_buffer->completion);
log_printf (" history . . . . . . . . : 0x%lx", ptr_buffer->history);
log_printf (" last_history. . . . . . : 0x%lx", ptr_buffer->last_history);
log_printf (" ptr_history . . . . . . : 0x%lx", ptr_buffer->ptr_history);
log_printf (" num_history . . . . . . : %d", ptr_buffer->num_history);
log_printf (" text_search . . . . . . : %d", ptr_buffer->text_search);
log_printf (" text_search_exact . . . : %d", ptr_buffer->text_search_exact);
log_printf (" text_search_regex . . . : %d", ptr_buffer->text_search_regex);
log_printf (" text_search_regex_compiled: 0x%lx", ptr_buffer->text_search_regex_compiled);
log_printf (" text_search_where . . . : %d", ptr_buffer->text_search_where);
log_printf (" text_search_found . . . : %d", ptr_buffer->text_search_found);
log_printf (" text_search_input . . . : '%s'", ptr_buffer->text_search_input);
log_printf (" highlight_words . . . . : '%s'", ptr_buffer->highlight_words);
log_printf (" highlight_regex . . . . : '%s'", ptr_buffer->highlight_regex);
log_printf (" highlight_regex_compiled: 0x%lx", ptr_buffer->highlight_regex_compiled);
log_printf (" highlight_tags_restrict. . . : '%s'", ptr_buffer->highlight_tags_restrict);
log_printf (" highlight_tags_restrict_count: %d", ptr_buffer->highlight_tags_restrict_count);
log_printf (" highlight_tags_restrict_array: 0x%lx", ptr_buffer->highlight_tags_restrict_array);
log_printf (" highlight_tags. . . . . : '%s'", ptr_buffer->highlight_tags);
log_printf (" highlight_tags_count. . : %d", ptr_buffer->highlight_tags_count);
log_printf (" highlight_tags_array. . : 0x%lx", ptr_buffer->highlight_tags_array);
log_printf (" text_search . . . . . . . . . . : %d", ptr_buffer->text_search);
log_printf (" text_search_exact . . . . . . . : %d", ptr_buffer->text_search_exact);
log_printf (" text_search_regex . . . . . . . : %d", ptr_buffer->text_search_regex);
log_printf (" text_search_regex_compiled. . . : 0x%lx", ptr_buffer->text_search_regex_compiled);
log_printf (" text_search_where . . . . . . . : %d", ptr_buffer->text_search_where);
log_printf (" text_search_found . . . . . . . : %d", ptr_buffer->text_search_found);
log_printf (" text_search_input . . . . . . . : '%s'", ptr_buffer->text_search_input);
log_printf (" highlight_words . . . . . . . . : '%s'", ptr_buffer->highlight_words);
log_printf (" highlight_disable_regex . . . . : '%s'", ptr_buffer->highlight_disable_regex);
log_printf (" highlight_disable_regex_compiled: 0x%lx", ptr_buffer->highlight_disable_regex_compiled);
log_printf (" highlight_regex . . . . . . . . : '%s'", ptr_buffer->highlight_regex);
log_printf (" highlight_regex_compiled. . . . : 0x%lx", ptr_buffer->highlight_regex_compiled);
log_printf (" highlight_tags_restrict . . . . : '%s'", ptr_buffer->highlight_tags_restrict);
log_printf (" highlight_tags_restrict_count . : %d", ptr_buffer->highlight_tags_restrict_count);
log_printf (" highlight_tags_restrict_array . : 0x%lx", ptr_buffer->highlight_tags_restrict_array);
log_printf (" highlight_tags. . . . . . . . . : '%s'", ptr_buffer->highlight_tags);
log_printf (" highlight_tags_count. . . . . . : %d", ptr_buffer->highlight_tags_count);
log_printf (" highlight_tags_array. . . . . . : 0x%lx", ptr_buffer->highlight_tags_array);
log_printf (" hotlist . . . . . . . . : 0x%lx", ptr_buffer->hotlist);
log_printf (" hotlist_removed . . . . : 0x%lx", ptr_buffer->hotlist_removed);
log_printf (" keys. . . . . . . . . . : 0x%lx", ptr_buffer->keys);
+5 -1
View File
@@ -199,6 +199,8 @@ struct t_gui_buffer
char *highlight_words; /* list of words to highlight */
char *highlight_regex; /* regex for highlight */
regex_t *highlight_regex_compiled; /* compiled regex */
char *highlight_disable_regex; /* regex for disabling highlight */
regex_t *highlight_disable_regex_compiled; /* compiled regex */
char *highlight_tags_restrict; /* restrict highlight to these tags */
int highlight_tags_restrict_count; /* number of restricted tags */
char ***highlight_tags_restrict_array; /* array with restricted tags */
@@ -316,8 +318,10 @@ extern void gui_buffer_set_title (struct t_gui_buffer *buffer,
const char *new_title);
extern void gui_buffer_set_highlight_words (struct t_gui_buffer *buffer,
const char *new_highlight_words);
extern void gui_buffer_set_highlight_disable_regex (struct t_gui_buffer *buffer,
const char *new_regex);
extern void gui_buffer_set_highlight_regex (struct t_gui_buffer *buffer,
const char *new_highlight_regex);
const char *new_regex);
extern void gui_buffer_set_highlight_tags_restrict (struct t_gui_buffer *buffer,
const char *new_tags);
extern void gui_buffer_set_highlight_tags (struct t_gui_buffer *buffer,
+104 -55
View File
@@ -27,6 +27,7 @@
#include <stddef.h>
#include <string.h>
#include <time.h>
#include <regex.h>
#include "../core/weechat.h"
#include "../core/wee-config.h"
@@ -861,9 +862,18 @@ gui_line_get_nick_tag (struct t_gui_line *line)
int
gui_line_has_highlight (struct t_gui_line *line)
{
int rc, i, no_highlight, action, length;
int rc, rc_regex, i, no_highlight, action, length;
char *msg_no_color, *ptr_msg_no_color, *highlight_words;
const char *ptr_nick;
regmatch_t regex_match;
rc = 0;
/* remove color codes from line message */
msg_no_color = gui_color_decode (line->data->message, NULL);
if (!msg_no_color)
return 0;
ptr_msg_no_color = msg_no_color;
/*
* highlights are disabled on this buffer? (special value "-" means that
@@ -871,7 +881,10 @@ gui_line_has_highlight (struct t_gui_line *line)
*/
if (line->data->buffer->highlight_words
&& (strcmp (line->data->buffer->highlight_words, "-") == 0))
return 0;
{
rc = 0;
goto end;
}
/*
* check if highlight is disabled for line; also check if the line is an
@@ -898,50 +911,11 @@ gui_line_has_highlight (struct t_gui_line *line)
}
}
if (no_highlight)
return 0;
/*
* check if highlight is forced by a tag
* (with global option "weechat.look.highlight_tags")
*/
if (config_highlight_tags
&& gui_line_match_tags (line->data,
config_num_highlight_tags,
config_highlight_tags))
{
return 1;
rc = 0;
goto end;
}
/*
* check if highlight is forced by a tag
* (with buffer property "highlight_tags")
*/
if (line->data->buffer->highlight_tags
&& gui_line_match_tags (line->data,
line->data->buffer->highlight_tags_count,
line->data->buffer->highlight_tags_array))
{
return 1;
}
/*
* check that line matches highlight tags, if any (if no tag is specified,
* then any tag is allowed)
*/
if (line->data->buffer->highlight_tags_restrict_count > 0)
{
if (!gui_line_match_tags (line->data,
line->data->buffer->highlight_tags_restrict_count,
line->data->buffer->highlight_tags_restrict_array))
return 0;
}
/* remove color codes from line message */
msg_no_color = gui_color_decode (line->data->message, NULL);
if (!msg_no_color)
return 0;
ptr_msg_no_color = msg_no_color;
/*
* if the line is an action message and that we know the nick, we skip
* the nick if it is at beginning of message (to not highlight an action
@@ -963,6 +937,77 @@ gui_line_has_highlight (struct t_gui_line *line)
}
}
/*
* check if highlight is disabled by a regex
* (with global option "weechat.look.highlight_disable_regex")
*/
if (config_highlight_disable_regex)
{
rc_regex = regexec (config_highlight_disable_regex,
ptr_msg_no_color, 1, &regex_match, 0);
if ((rc_regex == 0) && (regex_match.rm_so >= 0) && (regex_match.rm_eo > 0))
{
rc = 0;
goto end;
}
}
/*
* check if highlight is disabled by a regex
* (with buffer property "highlight_disable_regex")
*/
if (line->data->buffer->highlight_disable_regex_compiled)
{
rc_regex = regexec (line->data->buffer->highlight_disable_regex_compiled,
ptr_msg_no_color, 1, &regex_match, 0);
if ((rc_regex == 0) && (regex_match.rm_so >= 0) && (regex_match.rm_eo > 0))
{
rc = 0;
goto end;
}
}
/*
* check if highlight is forced by a tag
* (with global option "weechat.look.highlight_tags")
*/
if (config_highlight_tags
&& gui_line_match_tags (line->data,
config_num_highlight_tags,
config_highlight_tags))
{
rc = 1;
goto end;
}
/*
* check if highlight is forced by a tag
* (with buffer property "highlight_tags")
*/
if (line->data->buffer->highlight_tags
&& gui_line_match_tags (line->data,
line->data->buffer->highlight_tags_count,
line->data->buffer->highlight_tags_array))
{
rc = 1;
goto end;
}
/*
* check that line matches highlight tags, if any (if no tag is specified,
* then any tag is allowed)
*/
if (line->data->buffer->highlight_tags_restrict_count > 0)
{
if (!gui_line_match_tags (line->data,
line->data->buffer->highlight_tags_restrict_count,
line->data->buffer->highlight_tags_restrict_array))
{
rc = 0;
goto end;
}
}
/*
* there is highlight on line if one of buffer highlight words matches line
* or one of global highlight words matches line
@@ -974,30 +1019,34 @@ gui_line_has_highlight (struct t_gui_line *line)
highlight_words : line->data->buffer->highlight_words);
if (highlight_words)
free (highlight_words);
if (rc)
goto end;
if (!rc)
{
highlight_words = gui_buffer_string_replace_local_var (line->data->buffer,
CONFIG_STRING(config_look_highlight));
rc = string_has_highlight (ptr_msg_no_color,
(highlight_words) ?
highlight_words : CONFIG_STRING(config_look_highlight));
if (highlight_words)
free (highlight_words);
}
highlight_words = gui_buffer_string_replace_local_var (line->data->buffer,
CONFIG_STRING(config_look_highlight));
rc = string_has_highlight (ptr_msg_no_color,
(highlight_words) ?
highlight_words : CONFIG_STRING(config_look_highlight));
if (highlight_words)
free (highlight_words);
if (rc)
goto end;
if (!rc && config_highlight_regex)
if (config_highlight_regex)
{
rc = string_has_highlight_regex_compiled (ptr_msg_no_color,
config_highlight_regex);
}
if (rc)
goto end;
if (!rc && line->data->buffer->highlight_regex_compiled)
if (line->data->buffer->highlight_regex_compiled)
{
rc = string_has_highlight_regex_compiled (ptr_msg_no_color,
line->data->buffer->highlight_regex_compiled);
}
end:
free (msg_no_color);
return rc;