Skip to content
This repository was archived by the owner on Jul 21, 2018. It is now read-only.

Commit c253d0c

Browse files
committed
GUI: added file watcher for new script pane
1 parent 95c84a3 commit c253d0c

14 files changed

+186
-160
lines changed

ChangeLog

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CHANGELOG Highlight
22

33
highlight 3.42
44

5-
19.01.2018
5+
20.01.2018
66

77
-fixed HL_OUTPUT in Lua state for HL_FORMAT_XHTML and HL_FORMAT_TRUECOLOR values
88
-fixed lib-shared make target
@@ -12,12 +12,14 @@ highlight 3.42
1212
-added reformatting style ratliff (replaces banner)
1313
-added extras/langDefs-resources/cleanslate.lang (thanks to Tristano Ajmone)
1414
-improved Perl6 compatibility
15+
-improved PHP string interpolation
1516
-improved Haskell definition (https://github.com/andre-simon/highlight/pull/52)
1617
-CLI: added --canvas option to define background color padding in ANSI output
1718
(https://github.com/andre-simon/highlight/issues/40)
1819
-GUI: added French translation (thanks to Antoine Belvire)
1920
-GUI: added Scripts tab (suggested by Tristano Ajmone)
20-
21+
-GUI: minor bugfixes
22+
2123
---
2224
27.11.2017
2325

gui_files/l10n/highlight_de_DE.qm

193 Bytes
Binary file not shown.

langDefs/dart.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Keywords={
3030
Strings = {
3131
Delimiter=[['|"]],
3232
RawPrefix="r",
33+
Interpolation=[[\$\w+]],
3334
Escape = [[ \\u\d{4}|\\x?\d{3}|\\\w|\\[\'\\\"] ]]
3435
}
3536

langDefs/php.lang

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Keywords={
2323
List={"int", "integer", "real", "double", "float", "string", "array", "object", "bool", "mixed", "numeric"},
2424
},
2525
{ Id=3,
26-
Regex=[[\$\w+]],
26+
Regex=[[\$[\w\-"|'|\>]+|\$?\{.+?\}]],
2727
},
2828
{ Id=4,
2929
Regex=[[(\w+)\s*\(]],
@@ -32,9 +32,9 @@ Keywords={
3232

3333
-- hereDoc opening delimiter, see OnStateChange to handle end of string
3434
Strings={
35-
Delimiter=[["|'|<<<'?\w+'?]],
36-
--Interpolation=[[ \$[\w\[\]\->]+ ]],
37-
Interpolation=[[ [@\$%]\w+ ]]
35+
Delimiter=[["|'|<<<'?[\w_]+'?]],
36+
Escape=[=[ \\\d{3}|\\u\d{4}|\\x[[:xdigit:]]{2}|\\[ntvbrfa\\\?'"\$] ]=],
37+
--Interpolation = [[ \$\w+\[.+?\] ]]
3838
}
3939

4040
IgnoreCase=true
@@ -59,17 +59,21 @@ function OnStateChange(oldState, newState, token)
5959
end
6060

6161

62-
if (string.sub(token,1,1) =="$") and oldState==HL_STRING and newState==HL_KEYWORD then
62+
if (string.sub(token,1,1) =="$" or string.sub(token,1,1) =="{") and oldState==HL_STRING and newState==HL_KEYWORD then
6363
return HL_INTERPOLATION
6464
end
6565

66+
if (string.sub(token,1,1) =="{") and oldState~=HL_STRING and newState==HL_KEYWORD then
67+
return HL_REJECT
68+
end
69+
6670
if hereDoc~=nil then
6771
return HL_STRING
6872
end
6973

7074
--recognize hereDoc multine strings
7175
if oldState==HL_STANDARD and newState==HL_STRING and not string.find("\"'", token) then
72-
hereDoc = string.match(token, "<<<'?(%a+)" )
76+
hereDoc = string.match(token, "<<<'?([%a_]+)" )
7377
end
7478

7579
if oldState~=HL_STRING and newState==HL_ESC_SEQ then

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ install:
115115
@echo
116116
@echo "Done."
117117
@echo "Type highlight --help or man highlight for instructions."
118-
@echo "Take a look at ${DESTDIR}${examples_dir} for plugins and SWIG and TCL language bindings."
118+
@echo "Take a look at ${DESTDIR}${examples_dir} for web plugins, SWIG and TCL bindings."
119119
@echo "Execute 'make install-gui' to install the highlight GUI ('make gui')."
120120
@echo "Do not hesitate to report problems. Unknown bugs are hard to fix."
121121

src/gui-qt/highlight_cs_CZ.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,6 @@ This feature is enabled for C, C++, C# and Java code.</source>
10541054
<source>Add custom script to pool</source>
10551055
<translation type="unfinished"></translation>
10561056
</message>
1057-
<message>
1058-
<source>You can check one file of each type (syntax and theme) to override the default behaviour.</source>
1059-
<translation type="unfinished"></translation>
1060-
</message>
10611057
<message>
10621058
<source>Remove the selected scripts.</source>
10631059
<translation type="unfinished"></translation>
@@ -1074,6 +1070,10 @@ This feature is enabled for C, C++, C# and Java code.</source>
10741070
<source>Script description</source>
10751071
<translation type="unfinished"></translation>
10761072
</message>
1073+
<message>
1074+
<source>You can check one file of each type (syntax and theme) to override the default behaviour. If checked, the scripts will be watched for changes.</source>
1075+
<translation type="unfinished"></translation>
1076+
</message>
10771077
</context>
10781078
<context>
10791079
<name>ShowTextFile</name>

src/gui-qt/highlight_de_DE.ts

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ Installation prüfen.</translation>
2121
Installation prüfen.</translation>
2222
</message>
2323
<message>
24-
<location filename="mainwindow.cpp" line="168"/>
24+
<location filename="mainwindow.cpp" line="169"/>
2525
<source>Always at your service</source>
2626
<translation>Stets zu Diensten</translation>
2727
</message>
2828
<message>
29-
<location filename="mainwindow.cpp" line="183"/>
29+
<location filename="mainwindow.cpp" line="184"/>
3030
<source>Select one or more files to open</source>
3131
<translation>Wähle eine oder mehrere Dateien zum Öffnen</translation>
3232
</message>
3333
<message>
34-
<location filename="mainwindow.cpp" line="219"/>
34+
<location filename="mainwindow.cpp" line="221"/>
3535
<source>Select destination directory</source>
3636
<translation>Wähle das Zielverzeichnis</translation>
3737
</message>
@@ -44,92 +44,92 @@ Installation prüfen.</translation>
4444
<translation type="obsolete">Konnte Tags-Informationen in %1 nicht lesen</translation>
4545
</message>
4646
<message>
47-
<location filename="mainwindow.cpp" line="836"/>
48-
<location filename="mainwindow.cpp" line="867"/>
47+
<location filename="mainwindow.cpp" line="839"/>
48+
<location filename="mainwindow.cpp" line="870"/>
4949
<source>Output error</source>
5050
<translation>Ausgabefehler</translation>
5151
</message>
5252
<message>
53-
<location filename="mainwindow.cpp" line="836"/>
53+
<location filename="mainwindow.cpp" line="839"/>
5454
<source>Output directory does not exist!</source>
5555
<translation>Zielverzeichnis existert nicht!</translation>
5656
</message>
5757
<message>
58-
<location filename="mainwindow.cpp" line="867"/>
58+
<location filename="mainwindow.cpp" line="870"/>
5959
<source>You must define a style output file!</source>
6060
<translation>Sie müssen ein Stylesheet zur Ausgabe angeben!</translation>
6161
</message>
6262
<message>
63-
<location filename="mainwindow.cpp" line="899"/>
63+
<location filename="mainwindow.cpp" line="902"/>
6464
<source>Processing %1 (%2/%3)</source>
6565
<translation>Verarbeite %1 (%2/%3)</translation>
6666
</message>
6767
<message>
68-
<location filename="mainwindow.cpp" line="905"/>
68+
<location filename="mainwindow.cpp" line="908"/>
6969
<source>Language definition error</source>
7070
<translation>Fehler in Sprachdefinition</translation>
7171
</message>
7272
<message>
73-
<location filename="mainwindow.cpp" line="906"/>
73+
<location filename="mainwindow.cpp" line="909"/>
7474
<source>Invalid regular expression in %1:
7575
%2</source>
7676
<translation>Ungültiger regulärer Ausdruck in %1: %2</translation>
7777
</message>
7878
<message>
79-
<location filename="mainwindow.cpp" line="910"/>
79+
<location filename="mainwindow.cpp" line="913"/>
8080
<source>Unknown syntax</source>
8181
<translation>Unbekannte Syntax</translation>
8282
</message>
8383
<message>
84-
<location filename="mainwindow.cpp" line="910"/>
84+
<location filename="mainwindow.cpp" line="913"/>
8585
<source>Could not convert %1</source>
8686
<translation>Konnte %1 nicht konvertieren</translation>
8787
</message>
8888
<message>
89-
<location filename="mainwindow.cpp" line="913"/>
89+
<location filename="mainwindow.cpp" line="916"/>
9090
<source>Lua error</source>
9191
<translation>Lua Fehler</translation>
9292
</message>
9393
<message>
94-
<location filename="mainwindow.cpp" line="913"/>
94+
<location filename="mainwindow.cpp" line="916"/>
9595
<source>Could not convert %1:
9696
Lua Syntax error: %2</source>
9797
<translation>Konnte %1 nicht konvertieren:\nLua Syntaxfehler: %2</translation>
9898
</message>
9999
<message>
100-
<location filename="mainwindow.cpp" line="986"/>
100+
<location filename="mainwindow.cpp" line="989"/>
101101
<source>Converted %1 files in %2 ms</source>
102102
<translation>%1 Dateien in %2 ms konvertiert</translation>
103103
</message>
104104
<message>
105-
<location filename="mainwindow.cpp" line="1084"/>
105+
<location filename="mainwindow.cpp" line="1087"/>
106106
<source>Conversion of &quot;%1&quot; not possible.</source>
107107
<translation>Konnte &quot;%1&quot; nicht konvertieren.</translation>
108108
</message>
109109
<message>
110-
<location filename="mainwindow.cpp" line="1084"/>
111-
<location filename="mainwindow.cpp" line="1194"/>
112-
<location filename="mainwindow.cpp" line="1215"/>
110+
<location filename="mainwindow.cpp" line="1087"/>
111+
<location filename="mainwindow.cpp" line="1198"/>
112+
<location filename="mainwindow.cpp" line="1219"/>
113113
<source>clipboard data</source>
114114
<translation>Daten der Zwischenablage</translation>
115115
</message>
116116
<message>
117-
<location filename="mainwindow.cpp" line="1149"/>
117+
<location filename="mainwindow.cpp" line="1153"/>
118118
<source>%1 options</source>
119119
<translation>%1-Optionen</translation>
120120
</message>
121121
<message>
122-
<location filename="mainwindow.cpp" line="1185"/>
122+
<location filename="mainwindow.cpp" line="1189"/>
123123
<source>(user script)</source>
124124
<translation>(Benutzerskript)</translation>
125125
</message>
126126
<message>
127-
<location filename="mainwindow.cpp" line="1193"/>
127+
<location filename="mainwindow.cpp" line="1197"/>
128128
<source>Preview (%1):</source>
129129
<translation>Vorschau (%1):</translation>
130130
</message>
131131
<message>
132-
<location filename="mainwindow.cpp" line="1196"/>
132+
<location filename="mainwindow.cpp" line="1200"/>
133133
<source>Current syntax: %1 %2</source>
134134
<translation>Aktuelle Syntax: %1 %2</translation>
135135
</message>
@@ -138,12 +138,12 @@ Lua Syntax error: %2</source>
138138
<translation type="vanished">Aktuelle Syntax: %1</translation>
139139
</message>
140140
<message>
141-
<location filename="mainwindow.cpp" line="1215"/>
141+
<location filename="mainwindow.cpp" line="1219"/>
142142
<source>Preview of &quot;%1&quot; not possible.</source>
143143
<translation>Vorschau von &quot;%1&quot; nicht möglich.</translation>
144144
</message>
145145
<message>
146-
<location filename="mainwindow.cpp" line="1447"/>
146+
<location filename="mainwindow.cpp" line="1459"/>
147147
<source>Some plug-in effects may not be visible in the preview.</source>
148148
<translation>Einige Plug-In Effekte könnten in der Vorschau nicht dargestellt werden.</translation>
149149
</message>
@@ -152,20 +152,20 @@ Lua Syntax error: %2</source>
152152
<translation type="obsolete">Wählen Sie eine ctags Datei</translation>
153153
</message>
154154
<message>
155-
<location filename="mainwindow.cpp" line="1252"/>
156155
<location filename="mainwindow.cpp" line="1256"/>
157156
<location filename="mainwindow.cpp" line="1260"/>
158-
<location filename="mainwindow.cpp" line="1265"/>
157+
<location filename="mainwindow.cpp" line="1264"/>
158+
<location filename="mainwindow.cpp" line="1269"/>
159159
<source>Choose a style include file</source>
160160
<translation>Wählen Sie ein Eingabe-Stylesheet</translation>
161161
</message>
162162
<message>
163-
<location filename="mainwindow.cpp" line="1270"/>
163+
<location filename="mainwindow.cpp" line="1274"/>
164164
<source>About providing translations</source>
165165
<translation>Übersetzungen bereitstellen</translation>
166166
</message>
167167
<message>
168-
<location filename="mainwindow.cpp" line="1271"/>
168+
<location filename="mainwindow.cpp" line="1275"/>
169169
<source>The GUI was developed using the Qt toolkit, and translations may be provided using the tools Qt Linguist and lrelease.
170170
The highlight.ts file for Linguist resides in the src/gui-qt subdirectory.
171171
The qm file generated by lrelease has to be saved in gui-files/l10n.
@@ -178,17 +178,17 @@ Die von lrelease ausgegebene qm-Datei wird in gui-files/l10n gespeichert.
178178
Bitte senden Sie eine Nachricht an as (at) andre-simon (dot) de, wenn Sie Probleme bei der Übersetzung haben oder wenn Sie eine Übersetzung fertiggestellt bzw. aktualisiert haben.</translation>
179179
</message>
180180
<message>
181-
<location filename="mainwindow.cpp" line="1329"/>
181+
<location filename="mainwindow.cpp" line="1333"/>
182182
<source>Select one or more plug-ins</source>
183183
<translation>Wähle ein Plug-in</translation>
184184
</message>
185185
<message>
186-
<location filename="mainwindow.cpp" line="1340"/>
186+
<location filename="mainwindow.cpp" line="1344"/>
187187
<source>Select one or more syntax or theme scripts</source>
188188
<translation>Wähle ein oder mehrere Syntax- oder Themeskripte aus</translation>
189189
</message>
190190
<message>
191-
<location filename="mainwindow.cpp" line="1396"/>
191+
<location filename="mainwindow.cpp" line="1402"/>
192192
<source>Choose a plug-in input file</source>
193193
<translation>Wähle eine Eingabedatei für Plug-Ins aus</translation>
194194
</message>
@@ -811,8 +811,9 @@ Siehe ctags.sf.net um mehr darüber zu erfahren.</translation>
811811
</message>
812812
<message>
813813
<location filename="mainwindow.ui" line="677"/>
814-
<source>You can check one file of each type (syntax and theme) to override the default behaviour.</source>
815-
<translation>Du kannst eine Datei jeden Typs wählen (Syntax oder Theme), um die Ausgabe anzupassen.</translation>
814+
<source>You can check one file of each type (syntax and theme) to override the default behaviour. If checked, the scripts will be watched for changes.</source>
815+
<oldsource>You can check one file of each type (syntax and theme) to override the default behaviour.</oldsource>
816+
<translation>Du kannst eine Datei jeden Typs wählen (Syntax bzw. Theme), um die Ausgabe anzupassen. Bei Aktivierung wird das Skript auf Änderungen überwacht.</translation>
816817
</message>
817818
<message>
818819
<location filename="mainwindow.ui" line="686"/>
@@ -1264,7 +1265,7 @@ Setze die Anzahl auf Null, um Tabs auszugeben.</translation>
12641265
<location filename="mainwindow.ui" line="535"/>
12651266
<source>List of plug-ins. Toggle checkbox to enable the scripts. The preview window may not display all plug-in effects.</source>
12661267
<oldsource>List of plug-ins. Toggle checkbox to enable the scripts.</oldsource>
1267-
<translation>Liste der Plug-Ins. Klicke auf die Checkboxen um Skripte zu aktivieren.Die Vorschau zeigt möglicherweise nicht alle Effekte an.</translation>
1268+
<translation>Liste der Plug-Ins. Klicke auf die Checkboxen um Skripte zu aktivieren. Die Vorschau zeigt möglicherweise nicht alle Effekte an.</translation>
12681269
</message>
12691270
<message>
12701271
<location filename="mainwindow.ui" line="553"/>

0 commit comments

Comments
 (0)