1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 06:45:41 +02:00

core: add syntax highlighting in evaluation of expressions, add option weechat.color.eval_syntax_colors (issue #2042)

Syntax highlighting (raw string without evaluation): `${raw_hl:xxx}`
Syntax highlighting: `${hl:xxx}`
This commit is contained in:
Sébastien Helleu
2023-11-23 08:18:22 +01:00
parent 2b0c2747ad
commit 87f74e9f95
26 changed files with 5803 additions and 3503 deletions
+1
View File
@@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele
New features::
* core: add syntax highlighting in evaluation of expressions with `raw_hl:string` and `hl:string`, add option weechat.color.eval_syntax_colors (issue #2042)
* core: add option `search_history` in command `/input`, add key kbd:[Ctrl+r] to search in commands history, add key context "histsearch" (issue #2040)
* core: add option weechat.look.buffer_search_history (issue #2040)
* core: add key kbd:[Ctrl+o] to send command found and insert next one in input (issue #2040)
+11 -1
View File
@@ -2567,7 +2567,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0._
2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0, 4.2.0._
Evaluate an expression and return result as a string.
Special variables with format `+${variable}+` are expanded (see table below).
@@ -2900,11 +2900,21 @@ expanded to last):
|===
| Format | Min WeeChat | Description | Examples
| `+${raw_hl:xxx}+` | 4.2.0
| Raw string (not evaluated), with syntax highlighting (using colors).
| >> `+${raw_hl:${cut:1,,${rev:hello}}}+` +
== `+${cut:1,,${rev:hello}}+` (with colors)
| `+${raw:xxx}+` | 3.1
| Raw string (not evaluated).
| >> `+${raw:${info:version}}+` +
== `+${info:version}+`
| `+${hl:xxx}+` | 4.2.0
| String with syntax highlighting (using colors).
| >> `+${hl:${file.section.option}}+` +
== `+test ${variable}+` (with colors)
| `+${name}+` | 3.4
| User variable (defined with `+${define:name,value}+`).
| >> `+${name}+` +
+12 -1
View File
@@ -2613,7 +2613,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression
_WeeChat ≥ 0.4.0, mis à jour dans la 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8,
2.0, 2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0._
2.0, 2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0, 4.2.0._
Évaluer l'expression et retourner le résultat sous forme de chaîne.
Les variables spéciales avec le format `+${variable}+` sont étendues (voir le
@@ -2952,11 +2952,22 @@ première étendue à la dernière) :
|===
| Format | WeeChat mini | Description | Exemples
| `+${raw_hl:xxx}+` | 4.2.0
| Chaîne brute (non évaluée), avec mise en évidence de la syntaxe (en utilisant
des couleurs).
| >> `+${raw_hl:${cut:1,,${rev:hello}}}+` +
== `+${cut:1,,${rev:hello}}+` (avec des couleurs)
| `+${raw:xxx}+` | 3.1
| Chaîne brute (non évaluée).
| >> `+${raw:${info:version}}+` +
== `+${info:version}+`
| `+${hl:xxx}+` | 4.2.0
| Chaîne avec mise en évidence de la syntaxe (en utilisant des couleurs).
| >> `+${hl:${fichier.section.option}}+` +
== `+test ${variable}+` (avec des couleurs)
| `+${nom}+` | 3.4
| Variable définie par l'utilisateur (avec `+${define:nom,valeur}+`).
| >> `+${nom}+` +
+11 -1
View File
@@ -2717,7 +2717,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0._
2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0, 4.2.0._
Evaluate an expression and return result as a string.
Special variables with format `+${variable}+` are expanded (see table below).
@@ -3050,11 +3050,21 @@ expanded to last):
|===
| Format | Min WeeChat | Description | Examples
| `+${raw_hl:xxx}+` | 4.2.0
| Raw string (not evaluated), with syntax highlighting (using colors).
| >> `+${raw_hl:${cut:1,,${rev:hello}}}+` +
== `+${cut:1,,${rev:hello}}+` (with colors)
| `+${raw:xxx}+` | 3.1
| Raw string (not evaluated).
| >> `+${raw:${info:version}}+` +
== `+${info:version}+`
| `+${hl:xxx}+` | 4.2.0
| String with syntax highlighting (using colors).
| >> `+${hl:${file.section.option}}+` +
== `+test ${variable}+` (with colors)
| `+${name}+` | 3.4
| User variable (defined with `+${define:name,value}+`).
| >> `+${name}+` +
+13 -1
View File
@@ -2637,7 +2637,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
// TRANSLATION MISSING
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0._
2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6, 3.8, 4.0.0, 4.2.0._
式を評価して文字列として返す。`+${variable}+`
という書式で書かれた特殊変数は展開されます (以下の表を参照)。
@@ -2980,12 +2980,24 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
// TRANSLATION MISSING
| 書式 | Min WeeChat | 説明 | 例
// TRANLSATION MISSING
| `+${raw_hl:xxx}+` | 4.2.0
| Raw string (not evaluated), with syntax highlighting (using colors).
| >> `+${raw_hl:${cut:1,,${rev:hello}}}+` +
== `+${cut:1,,${rev:hello}}+` (with colors)
// TRANSLATION MISSING
| `+${raw:xxx}+` | 3.1
| Raw string (not evaluated).
| >> `+${raw:${info:version}}+` +
== `+${info:version}+`
// TRANSLATION MISSING
| `+${hl:xxx}+` | 4.2.0
| String with syntax highlighting (using colors).
| >> `+${hl:${file.section.option}}+` +
== `+test ${variable}+` (with colors)
// TRANSLATION MISSING
| `+${name}+` | 3.4
| User variable (defined with `+${define:name,value}+`).
+13 -1
View File
@@ -2479,7 +2479,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression
_WeeChat ≥ 0.4.0, ажурирано у верзијама 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0, 2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6 и 3.8, 4.0.0._
_WeeChat ≥ 0.4.0, ажурирано у верзијама 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0, 2.2, 2.3, 2.7, 2.9, 3.1, 3.2, 3.3, 3.4, 3.6 и 3.8, 4.0.0, 4.2.0._
Израчунава израз и враћа вредност као стринг. Специјалне променљиве у формату `+${променљива}+` се развијају (погледајте табелу испод).
@@ -2789,11 +2789,23 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|===
| Формат | Мин WeeChat | Опис | Примери
// TRANLSATION MISSING
| `+${raw_hl:xxx}+` | 4.2.0
| Raw string (not evaluated), with syntax highlighting (using colors).
| >> `+${raw_hl:${cut:1,,${rev:hello}}}+` +
== `+${cut:1,,${rev:hello}}+` (with colors)
| `+${raw:xxx}+` | 3.1
| Сирови стринг (не израчунава се).
| >> `+${raw:${info:version}}+` +
== `+${info:version}+`
// TRANSLATION MISSING
| `+${hl:xxx}+` | 4.2.0
| String with syntax highlighting (using colors).
| >> `+${hl:${file.section.option}}+` +
== `+test ${variable}+` (with colors)
| `+${име}+` | 3.4
| Корисничка променљива (дефинисана са `+${define:име,вредност}+`).
| >> `+${име}+` +
+17 -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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:09+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4792,6 +4792,19 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"barva textu pro přezdívky (čárkou oddělený seznam barev, pozadí je povoleno "
"ve formátu: \"fg:bg\", například: \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "barva textu pro akce ve vstupní řádce"
@@ -5696,6 +5709,9 @@ msgstr "Základní barvy WeeChat:"
msgid "Nick colors:"
msgstr "Barvy přezdívky:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "Aliasy barev:"
+26 -15
View File
File diff suppressed because it is too large Load Diff
+17 -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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:09+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4957,6 +4957,19 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"color para los apodos (lista de colores separadas por comas, color de fondo "
"es permitido siguiendo el formato \"fg:bg\", por ejemplo: \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "color para acciones en la línea de entrada"
@@ -5872,6 +5885,9 @@ msgstr "Colores básicos de WeeChat:"
msgid "Nick colors:"
msgstr "Colores de apodos:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "Alias de colores:"
+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: 2023-11-11 08:54+0100\n"
"PO-Revision-Date: 2023-11-11 08:57+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-11-23 08:16+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -5306,6 +5306,17 @@ msgstr ""
"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)"
#. TRANSLATORS: please do not translate "lightred:blue"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"couleur du texte pour la mise en évidence de la syntaxe dans les chaînes "
"évaluées, avec \"${raw_hl:...}\" et \"${hl:...}\" (liste de couleurs "
"séparées par une virgule, un fond est autorisé avec le format : \"couleur:"
"fond\", par exemple : \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "couleur du texte pour les actions dans la ligne de saisie"
@@ -6303,6 +6314,10 @@ msgstr "Couleurs de base WeeChat :"
msgid "Nick colors:"
msgstr "Couleurs des pseudos :"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
"Couleurs pour la mise en évidence de la syntaxe dans les chaînes évaluées :"
msgid "Color aliases:"
msgstr "Alias de couleurs :"
+12 -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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:09+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4515,6 +4515,14 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr "idő színe a beszédablakban"
#, fuzzy
msgid "text color for actions in input line"
msgstr "kilépési nyíl színe"
@@ -5406,6 +5414,9 @@ msgstr "WeeChat Hiba:"
msgid "Nick colors:"
msgstr "üzenetek színe"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
#, fuzzy
msgid "Color aliases:"
msgstr "Aliaszok listája:\n"
+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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:10+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4873,6 +4873,19 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"colore del testo per i nick (elenco separato da virgole di colori, quello di "
"sfondo è consentito con il formato \"fg:bg\", ad esempio: \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "colore del testo per le azioni sulla riga di input"
@@ -5820,6 +5833,9 @@ msgstr "Colori base di WeeChat:"
msgid "Nick colors:"
msgstr "Colori per nick:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "Alias colore:"
+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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:10+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -5053,6 +5053,19 @@ msgstr ""
"emphasized_attributes オプションが空文字列 (デフォルト値) の場合のみ使われま"
"す"
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"ニックネームのテキスト色 (コンマ区切りの色リスト、背景色は以下の書式で指定: "
"\"fg:bg\"、例: \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "入力がアクションの場合のテキスト色"
@@ -5978,6 +5991,9 @@ msgstr "WeeChat 基本色:"
msgid "Nick colors:"
msgstr "ニックネーム色:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "色別名:"
+5051 -3287
View File
File diff suppressed because it is too large Load Diff
+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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:10+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -5090,6 +5090,19 @@ msgstr ""
"só é utilizada se a opção weechat.look.emphasized_attributes for uma cadeia "
"vazia (valor predefinido)"
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"cor do texto dos nicks (lista de cores separadas por vírgula, o fundo pode "
"ser indicado com o formato: \"texto:fundo\", por exemplo: \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "cor do texto de ações na linha de entrada"
@@ -6045,6 +6058,9 @@ msgstr "Cores WeeChat básicas:"
msgid "Nick colors:"
msgstr "Cores dos nicks:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "Alias de cores:"
+17 -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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:11+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4836,6 +4836,19 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"cor do texto para apelidos (lista de cores separada por vírgulas, fundo é "
"permitido com o formato: \"fg:bg\", por exemplo: \"lightred:blue\")"
msgid "text color for actions in input line"
msgstr "cor de texto para ações de linha de entrada"
@@ -5736,6 +5749,9 @@ msgstr "Cores básicas do WeeChat:"
msgid "Nick colors:"
msgstr "Cores do apelido:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "Atalhos de Cor:"
+12 -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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:11+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4548,6 +4548,14 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr "цвет времени в окне чата"
#, fuzzy
msgid "text color for actions in input line"
msgstr "цвет действий в поле ввода"
@@ -5442,6 +5450,9 @@ msgstr "Ошибка WeeChat:"
msgid "Nick colors:"
msgstr "цвет чата"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
#, fuzzy
msgid "Color aliases:"
msgstr "Список сокращений:\n"
+156 -152
View File
File diff suppressed because it is too large Load Diff
+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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\n"
"PO-Revision-Date: 2023-10-20 13:11+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5088,6 +5088,19 @@ msgstr ""
"yalnızca weechat.look.emphasized_attributes seçeneği boş bir diziyse "
"kullanılır (öntanımlı değer)"
#. TRANSLATORS: please do not translate "lightred:blue"
#, fuzzy
#| msgid ""
#| "text color for nicks (comma separated list of colors, background is "
#| "allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
"takma ad metin rengi (renklerin virgülle ayrılmış bir listesi, arka plan "
"için \"fg:bg\" biçimiyle izin verilir; örneğin \"lightred:blue\""
msgid "text color for actions in input line"
msgstr "girdi satırındaki eylemler metin rengi"
@@ -6038,6 +6051,9 @@ msgstr "WeeChat temel renkleri:"
msgid "Nick colors:"
msgstr "Takma ad renkleri:"
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr "Renk armaları:"
+11 -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: 2023-11-11 08:54+0100\n"
"POT-Creation-Date: 2023-11-23 08:13+0100\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"
@@ -4206,6 +4206,13 @@ msgid ""
"(default value)"
msgstr ""
#. TRANSLATORS: please do not translate "lightred:blue"
msgid ""
"text color for syntax highlighting in evaluated strings, with "
"\"${raw_hl:...}\" and \"${hl:...}\" (comma separated list of colors, "
"background is allowed with format: \"fg:bg\", for example: \"lightred:blue\")"
msgstr ""
msgid "text color for actions in input line"
msgstr ""
@@ -5019,6 +5026,9 @@ msgstr ""
msgid "Nick colors:"
msgstr ""
msgid "Syntax highlighting colors in evaluated strings:"
msgstr ""
msgid "Color aliases:"
msgstr ""
+70 -1
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -321,6 +321,7 @@ extern struct t_config_option *config_color_chat_value;
extern struct t_config_option *config_color_chat_value_null;
extern struct t_config_option *config_color_emphasized;
extern struct t_config_option *config_color_emphasized_bg;
extern struct t_config_option *config_color_eval_syntax_colors;
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_item_away;
@@ -400,6 +401,8 @@ extern int config_word_chars_input_count;
extern char **config_nick_colors;
extern int config_num_nick_colors;
extern struct t_hashtable *config_hashtable_nick_color_force;
extern char **config_eval_syntax_colors;
extern int config_num_eval_syntax_colors;
extern char *config_buffer_time_same_evaluated;
extern struct t_hashtable *config_hashtable_completion_partial_templates;
+140 -10
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -37,6 +37,10 @@
#define EVAL_RANGE_ALPHA EVAL_RANGE_LOWER EVAL_RANGE_UPPER
#define EVAL_RANGE_ALNUM EVAL_RANGE_ALPHA EVAL_RANGE_DIGIT
#define EVAL_SYNTAX_HL_MARKER "\xef\xbf\xbf\xef\xbf\xbf"
#define EVAL_SYNTAX_HL_INC (EVAL_SYNTAX_HL_MARKER "+")
#define EVAL_SYNTAX_HL_DEC (EVAL_SYNTAX_HL_MARKER "-")
struct t_hashtable;
enum t_eval_logical_op
@@ -89,6 +93,8 @@ struct t_eval_context
struct t_eval_regex *regex; /* in case of replace with regex */
int regex_replacement_index; /* replacement index (≥ 1) */
int recursion_count; /* to prevent infinite recursion */
int syntax_highlight; /* syntax highlight: ${raw_hl:...} */
/* or ${hl:...} */
int debug_level; /* 0: no debug, 1: debug, 2: extra */
int debug_depth; /* used for debug indentation */
int debug_id; /* operation id in debug output */
+44 -21
View File
@@ -870,8 +870,8 @@ gui_color_info_term_colors (char *buffer, int size)
void
gui_color_buffer_display ()
{
int y, i, lines, columns, line, col, color, max_color, num_items;
char str_line[1024], str_color[64], str_rgb[64], **items;
int y, i, lines, columns, line, col, color, max_color;
char str_line[1024], str_color[64], str_rgb[64];
struct t_gui_color_palette *color_palette;
if (!gui_color_buffer)
@@ -1011,47 +1011,70 @@ gui_color_buffer_display ()
y++;
gui_chat_printf_y (gui_color_buffer, y++,
_("Nick colors:"));
items = string_split (CONFIG_STRING(config_color_chat_nick_colors),
",",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0,
&num_items);
if (items)
if (config_num_nick_colors > 0)
{
str_line[0] = '\0';
for (i = 0; i < num_items; i++)
for (i = 0; i < config_num_nick_colors; i++)
{
if (gui_color_use_term_colors)
{
snprintf (str_color, sizeof (str_color),
" %s",
items[i]);
config_nick_colors[i]);
}
else
{
snprintf (str_color, sizeof (str_color),
"%c %s%s",
GUI_COLOR_RESET_CHAR,
gui_color_get_custom (items[i]),
items[i]);
gui_color_get_custom (config_nick_colors[i]),
config_nick_colors[i]);
}
if (gui_chat_strlen_screen (str_line) + gui_chat_strlen_screen (str_color) > 80)
if (gui_chat_strlen_screen (str_line)
+ gui_chat_strlen_screen (str_color) > 80)
{
gui_chat_printf_y (gui_color_buffer, y++,
" %s", str_line);
gui_chat_printf_y (gui_color_buffer, y++, " %s", str_line);
str_line[0] = '\0';
}
strcat (str_line, str_color);
}
if (str_line[0])
gui_chat_printf_y (gui_color_buffer, y++, " %s", str_line);
}
/* display eval syntax highlighting colors */
y++;
gui_chat_printf_y (gui_color_buffer, y++,
_("Syntax highlighting colors in evaluated strings:"));
if (config_num_eval_syntax_colors > 0)
{
str_line[0] = '\0';
for (i = 0; i < config_num_eval_syntax_colors; i++)
{
gui_chat_printf_y (gui_color_buffer, y++,
" %s", str_line);
if (gui_color_use_term_colors)
{
snprintf (str_color, sizeof (str_color),
" %s",
config_eval_syntax_colors[i]);
}
else
{
snprintf (str_color, sizeof (str_color),
"%c %s%s",
GUI_COLOR_RESET_CHAR,
gui_color_get_custom (config_eval_syntax_colors[i]),
config_eval_syntax_colors[i]);
}
if (gui_chat_strlen_screen (str_line)
+ gui_chat_strlen_screen (str_color) > 80)
{
gui_chat_printf_y (gui_color_buffer, y++, " %s", str_line);
str_line[0] = '\0';
}
strcat (str_line, str_color);
}
string_free_split (items);
if (str_line[0])
gui_chat_printf_y (gui_color_buffer, y++, " %s", str_line);
}
/* display palette colors */
+75
View File
@@ -489,12 +489,87 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("", "${}");
WEE_CHECK_EVAL("", "${xyz}");
/* test raw string with syntax highlighting */
WEE_CHECK_EVAL("", "${raw_hl:}");
WEE_CHECK_EVAL("test", "${raw_hl:test}");
snprintf (str_value, sizeof (str_value),
"%s${info:version}%s",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value, "${raw_hl:${info:version}}");
snprintf (str_value, sizeof (str_value),
"test_%s${info:version}%s_end",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value, "test_${raw_hl:${info:version}}_end");
snprintf (str_value, sizeof (str_value),
"test_%s${cut:3,,%s${rev:%s${info:version}%s}%s}%s_end",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom (config_eval_syntax_colors[1]),
gui_color_get_custom (config_eval_syntax_colors[2]),
gui_color_get_custom (config_eval_syntax_colors[1]),
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value, "test_${raw_hl:${cut:3,,${rev:${info:version}}}}_end");
snprintf (str_value, sizeof (str_value),
"test_%s${raw:${test}}%s_end",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value, "test_${raw_hl:${raw:${test}}}_end");
snprintf (str_value, sizeof (str_value),
"test_%s${if:a==1?%s${yes}%s:%s${no}%s}%s_end",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom (config_eval_syntax_colors[1]),
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom (config_eval_syntax_colors[1]),
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value, "test_${raw_hl:${if:a==1?${yes}:${no}}}_end");
snprintf (str_value, sizeof (str_value),
"test_%s${a:%s${b:%s${c:%s${d:%s${e:%s${f:%s${g:%s${h:%s${i:}%s}%s}%s}%s}%s}%s}%s}%s}%s_end",
gui_color_get_custom (config_eval_syntax_colors[0 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[1 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[2 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[3 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[4 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[5 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[6 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[7 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[8 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[7 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[6 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[5 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[4 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[3 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[2 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[1 % config_num_eval_syntax_colors]),
gui_color_get_custom (config_eval_syntax_colors[0 % config_num_eval_syntax_colors]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value,
"test_${raw_hl:${a:${b:${c:${d:${e:${f:${g:${h:${i:}}}}}}}}}}_end");
/* test raw string */
WEE_CHECK_EVAL("", "${raw:}");
WEE_CHECK_EVAL("test", "${raw:test}");
WEE_CHECK_EVAL("${info:version}", "${raw:${info:version}}");
WEE_CHECK_EVAL("yes", "${if:${raw:test?}==${raw:test?}?yes:no}");
WEE_CHECK_EVAL("no", "${if:${raw:test?}==${raw:test}?yes:no}");
WEE_CHECK_EVAL("16", "${length:${raw:${buffer.number}}}");
/* test string with syntax highlighting */
WEE_CHECK_EVAL("", "${hl:}");
WEE_CHECK_EVAL("test", "${hl:test}");
snprintf (str_value, sizeof (str_value),
"%s${info:version}%s",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL("test_weechat_end", "test_${hl:${buffer.name}}_end");
snprintf (str_value, sizeof (str_value),
"test_%s${buffer.name}%s_end",
gui_color_get_custom (config_eval_syntax_colors[0]),
gui_color_get_custom ("reset"));
WEE_CHECK_EVAL(str_value, "test_${hl:${raw:${buffer.name}}}_end");
/* test eval of substring */
WEE_CHECK_EVAL("\t", "${eval:${\\t}}");