Skip to content

Commit 9e78df8

Browse files
committed
Release 2.1.18.
1 parent ef29d17 commit 9e78df8

File tree

10 files changed

+193
-73
lines changed

10 files changed

+193
-73
lines changed

Diff for: Application/Info.plist

+52-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<key>LSMinimumSystemVersion</key>
3434
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
3535
<key>NSHumanReadableCopyright</key>
36-
<string>Developed by SBAREX (2019-2022).</string>
36+
<string>Developed by SBAREX (2019-2023).</string>
3737
<key>NSMainStoryboardFile</key>
3838
<string>Storyboard</string>
3939
<key>NSPrincipalClass</key>
@@ -107,6 +107,23 @@
107107
</array>
108108
</dict>
109109
</dict>
110+
<dict>
111+
<key>UTTypeConformsTo</key>
112+
<array>
113+
<string>dyn.ah62d4rv4ge80c7mx</string>
114+
<string>public.data</string>
115+
</array>
116+
<key>UTTypeIdentifier</key>
117+
<string>com.autoit.au3</string>
118+
<key>UTTypeTagSpecification</key>
119+
<dict>
120+
<key>public.filename-extension</key>
121+
<array>
122+
<string>a3x</string>
123+
<string>au3</string>
124+
</array>
125+
</dict>
126+
</dict>
110127
<dict>
111128
<key>UTTypeConformsTo</key>
112129
<array>
@@ -371,6 +388,24 @@
371388
</array>
372389
</dict>
373390
</dict>
391+
<dict>
392+
<key>UTTypeConformsTo</key>
393+
<array>
394+
<string>public.item</string>
395+
<string>dyn.ah62d4rv4ge80k52</string>
396+
<string>dyn.ah62d4rv4ge80c3dt</string>
397+
</array>
398+
<key>UTTypeIdentifier</key>
399+
<string>com.stata.source</string>
400+
<key>UTTypeTagSpecification</key>
401+
<dict>
402+
<key>public.filename-extension</key>
403+
<array>
404+
<string>do</string>
405+
<string>ado</string>
406+
</array>
407+
</dict>
408+
</dict>
374409
<dict>
375410
<key>UTTypeConformsTo</key>
376411
<array>
@@ -992,6 +1027,22 @@
9921027
</array>
9931028
</dict>
9941029
</dict>
1030+
<dict>
1031+
<key>UTTypeConformsTo</key>
1032+
<array>
1033+
<string>dyn.ah62d4rv4ge80y65tr30a</string>
1034+
<string>public.json</string>
1035+
</array>
1036+
<key>UTTypeIdentifier</key>
1037+
<string>org.jsonlines.jsonl</string>
1038+
<key>UTTypeTagSpecification</key>
1039+
<dict>
1040+
<key>public.filename-extension</key>
1041+
<array>
1042+
<string>jsonl</string>
1043+
</array>
1044+
</dict>
1045+
</dict>
9951046
<dict>
9961047
<key>UTTypeConformsTo</key>
9971048
<array>

Diff for: Application/resources/colorize.sh

+62-50
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66
# Copyright 2007 Nathaniel Gray.
77
# Copyright 2012-2018 Anthony Gelibert.
8+
# Copyright 2019-2023 Sbarex.
89
#
910
# Expects $1 = name of file to colorize
1011
#
@@ -52,9 +53,7 @@ dos2unix="$pathDos2unix"
5253
if [ "x${targetHL}" = "x" ]; then
5354
echo "Error: missing target env!" >> ${err_device}
5455
exit 1
55-
fi
56-
57-
if [[ ! -a "$targetHL" ]]; then
56+
elif [[ ! -a "$targetHL" ]]; then
5857
echo "Error: missing target file!" >> ${err_device}
5958
exit 1
6059
fi
@@ -71,58 +70,71 @@ if [ "x${textEncoding}" = "x" ]; then
7170
textEncoding="UTF-8"
7271
fi
7372

74-
debug "Starting colorize.sh"
73+
debug 'Starting `colorize.sh`'
7574
if hash gdate 2>/dev/null; then
7675
else
77-
debug "# install gdate with \`brew install coreutils\` to show the nanoseconds time stamp #"
76+
debug '# Install `gdate` with `brew install coreutils` to show the nanoseconds time stamp #'
7877
fi
7978

79+
# Se il percorso del file viene passato tra doppi apici (che comportano l'espansione delle varibili che iniziano con $) è necessario proteggere nel valore i caratteri doppio apice e dollaro:
80+
# - protegge gli apici doppi " con \" e gli $ con \$.
81+
# - gli apici singoli ' non devono essere protetti dato che il percorso è racchiuso tra doppi apici.
82+
escaped_targetHL=$(echo ${targetHL} | sed "s/\"/\\\\\"/g;s/\\\$/\\\\\$/g")
83+
84+
# Se il percorso del file viene passato tra apici singoli (che non comportano l'espansione delle varibili e l'interpretazione di caratteri speciali) è necessario proteggere nel valore il carattere apice singolo:
85+
# - protegge gli apici singoli ' sostituendoli con '"'"'
86+
# - gli apici doppi " e $ non devono essere protetti dato che il percorso è racchiuso tra apici singoli.
87+
# https://stackoverflow.com/a/1250279/1409904
88+
# https://stackoverflow.com/a/42082956/1409904
89+
escaped_targetHL=$(echo ${targetHL} | sed "s/'/'\"'\"'/g")
90+
91+
8092
# Reader used to get the contents of the target file.
8193
if [[ ${convertEOL} != "" ]]; then
8294
#reader=(cat "'${targetHL}'" \| perl -p -e 's/\\r\\n/\\n/' \| tr '\\r' '\\n')
83-
reader=(cat "'${targetHL}'" \| "\"${dos2unix}\"" -c mac \| "\"${dos2unix}\"")
95+
reader=(cat "'${escaped_targetHL}'" \| "\"${dos2unix}\"" -c mac \| "\"${dos2unix}\"")
8496
else
85-
reader=(cat "'${targetHL}'")
97+
reader=(cat "'${escaped_targetHL}'")
8698
fi
8799

88-
# debug "Handling special cases"
89-
case "${targetHL}" in
90-
*.graffle | *.ps )
91-
exit 1
92-
;;
93-
*.d )
94-
lang=make
95-
;;
96-
# *.class )
97-
# lang=java
98-
# reader=(/usr/local/bin/jad -ff -dead -noctor -p -t "${targetHL}")
99-
# plugin=(--plug-in java_library)
100-
# ;;
101-
*.sql )
102-
if grep -q -E "SQLite .* database" <(file -b "${targetHL}"); then
103-
# skip binary sql databases.
104-
exit 1
105-
fi
106-
lang=sql
107-
;;
108-
*.pch | *.h )
109-
if grep -q "@interface" <("${targetHL}") &> /dev/null; then
110-
lang=objc
111-
else
112-
lang=h
113-
fi
114-
;;
115-
* )
116-
lang=${targetHL##*.}
117-
;;
118-
esac
119-
120100
if [[ ${syntaxHL} != "" ]]; then
121101
# Use the request file type.
122102
lang=${syntaxHL}
103+
else
104+
# debug "Handling special cases"
105+
case "${targetHL}" in
106+
*.graffle | *.ps )
107+
exit 1
108+
;;
109+
*.d )
110+
lang=make
111+
;;
112+
# *.class )
113+
# lang=java
114+
# reader=(/usr/local/bin/jad -ff -dead -noctor -p -t "'${escaped_targetHL}'")
115+
# plugin=(--plug-in java_library)
116+
# ;;
117+
*.sql )
118+
if grep -q -E "SQLite .* database" <(file -b "'${escaped_targetHL}'"); then
119+
# skip binary sql databases.
120+
exit 1
121+
fi
122+
lang=sql
123+
;;
124+
*.pch | *.h )
125+
if grep -q "@interface" <("'${escaped_targetHL}'") &> /dev/null; then
126+
lang=objc
127+
else
128+
lang=h
129+
fi
130+
;;
131+
* )
132+
lang=${targetHL##*.}
133+
;;
134+
esac
123135
fi
124136

125-
debug "Target to colorize: ${targetHL}"
137+
debug "Target to colorize: '${escaped_targetHL}'"
126138
debug "Resolved to language: $lang"
127139

128140
if [[ ${preprocessorHL} != "" ]]; then
@@ -142,7 +154,7 @@ go4it () {
142154

143155
if [ "x${useLSP}" != "x" ]; then
144156
# LSP require full path.
145-
cmdOptsHL+=(-i "${targetHL}")
157+
cmdOptsHL+=(-i "'${escaped_targetHL}'")
146158
fi
147159

148160
# debug "Environments:"
@@ -153,7 +165,7 @@ go4it () {
153165
# create a temporary file
154166
tmpfile=$(mktemp -t colorize)
155167
debug "Save reader output to a temporary file: $tmpfile"
156-
debug "\$ ${reader} > \"$tmpfile\""
168+
debug "\$ ${reader} \> \"$tmpfile\""
157169

158170
# apply preprocessor
159171
(eval ${reader}) > "$tmpfile" 2>> ${err_device}
@@ -251,15 +263,15 @@ go4it () {
251263

252264
debug "Generating the preview…"
253265

254-
debug "\$ head -c ${maxFileSizeHL} \"$tmpfile\" | \"${cmd}\" -T \"${targetHL}\" ${cmdOptsHL}"
266+
debug "\$ head -c ${maxFileSizeHL} \"$tmpfile\" | \"${cmd}\" -T '${escaped_targetHL}' ${cmdOptsHL}"
255267

256-
{head -c ${maxFileSizeHL} "$tmpfile" 2>> ${err_device} ; printf "\n\n${comment1} Output truncated: the file ($bytes bytes) exceed the $maxFileSizeHL bytes limit. ${comment2}\n\n" } | "${cmd}" -T "${targetHL}" ${cmdOptsHL} 2>> ${err_device}
268+
{head -c ${maxFileSizeHL} "$tmpfile" 2>> ${err_device} ; printf "\n\n${comment1} Output truncated: the file ($bytes bytes) exceed the $maxFileSizeHL bytes limit. ${comment2}\n\n" } | "${cmd}" -T "'${escaped_targetHL}'" ${cmdOptsHL} 2>> ${err_device}
257269
result=$?
258270
else
259271
debug "No need to truncate the data."
260272
debug "Generating the preview…"
261-
debug "\$ cat \"$tmpfile\" | \"${cmd}\" -T \"${targetHL}\" ${cmdOptsHL}"
262-
cat "$tmpfile" | "${cmd}" -T "${targetHL}" ${cmdOptsHL} 2>> ${err_device}
273+
debug "\$ cat \"$tmpfile\" | \"${cmd}\" -T '${escaped_targetHL}' ${cmdOptsHL}"
274+
cat "$tmpfile" | "${cmd}" -T "'${escaped_targetHL}'" ${cmdOptsHL} 2>> ${err_device}
263275
result=$?
264276
fi
265277

@@ -280,11 +292,11 @@ go4it () {
280292
else
281293
debug "Generating the preview…"
282294
if [ "x${useLSP}" != "x" ]; then
283-
debug "\$ \"${cmd}\" -T \"${targetHL}\" ${cmdOptsHL}"
284-
"${cmd}" -T "${targetHL}" ${cmdOptsHL} 2>> ${err_device}
295+
debug "\$ \"${cmd}\" -T '${escaped_targetHL}' ${cmdOptsHL}"
296+
"${cmd}" -T "'${escaped_targetHL}'" ${cmdOptsHL} 2>> ${err_device}
285297
else
286-
debug "\$ ${reader} | \"${cmd}\" -T \"${targetHL}\" ${cmdOptsHL}"
287-
(eval ${reader}) 2>> ${err_device} | "${cmd}" -T "${targetHL}" ${cmdOptsHL} 2>> ${err_device}
298+
debug "\$ ${reader} | \"${cmd}\" -T '${escaped_targetHL}' ${cmdOptsHL}"
299+
(eval ${reader}) 2>> ${err_device} | "${cmd}" -T "'${escaped_targetHL}'" ${cmdOptsHL} 2>> ${err_device}
288300
fi
289301

290302
result=$?

Diff for: Application/resources/settings.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ UTIs:
3030
com.apple.xcode.strings-dictionary: *plist
3131
com.apple.xcode.strings-text: *plist
3232

33+
com.autoit.au3:
34+
syntax: autoit
35+
dyn.ah62d4rv4ge80c7mx:
36+
syntax: autoit
37+
3338
com.barebones.bbedit.ini-configuration:
3439
syntax: ini
3540

@@ -111,6 +116,11 @@ UTIs:
111116
dyn.ah62d4rv4ge80y65tr3vu:
112117
syntax: json
113118

119+
org.jsonlines.jsonl:
120+
syntax: json
121+
dyn.ah62d4rv4ge80y65tr30a:
122+
syntax: json
123+
114124
org.microsoft.inf:
115125
syntax: ini
116126

@@ -318,6 +328,13 @@ UTIs:
318328
# .sol
319329
dyn.ah62d4rv4ge81g55q:
320330
syntax: sol
331+
332+
#.ado
333+
dyn.ah62d4rv4ge80c3dt:
334+
syntax: txt
335+
#.do
336+
dyn.ah62d4rv4ge80k52:
337+
syntax: txt
321338

322339
extensions:
323340
_plist*: &plist
@@ -330,6 +347,17 @@ extensions:
330347
_typescript*: &typescript
331348
syntax: typescript
332349

350+
ado:
351+
syntax: txt
352+
353+
au3:
354+
syntax: autoit
355+
a3x:
356+
syntax: autoit
357+
358+
do:
359+
syntax: txt
360+
333361
# org.nodejs.cjs, dyn.ah62d4rv4ge80g4xx
334362
cjs:
335363
syntax: javascript
@@ -379,6 +407,12 @@ extensions:
379407
# org.sbarex.conf
380408
syntax: ini
381409

410+
jsonl:
411+
syntax: json
412+
413+
mjs:
414+
syntax: javascript
415+
382416
# org.sbarex.ms-powershell-module-manifest:
383417
psd1:
384418
syntax: ps1

Diff for: CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ Changelog
22
=======
33

44

5+
### 2.1.18 (67)
6+
New features:
7+
- Update Highlight to release 4.5.
8+
- Update Lua to release 5.4.4.
9+
- Added support for Autoit files (`.au3`, `.a3x`).
10+
- Added support for JSON Lines files (`.jsonl`) _as JSON_.
11+
- Added support for Stata files (`.do`, `.ado`) _as plain text_.
12+
13+
Bugfix:
14+
- Fixed unrecognized `.mjs` files.
15+
- Fixed bug for preview files with special characters on the path.
16+
17+
518
### 2.1.17 (66)
619
New features:
720
- Added support for Crystal language (`.cr`)

Diff for: QLExtension/Info.plist

+8-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<string>com.apple.xcode.strings-dictionary</string>
5353
<string>com.apple.xcode.strings-text</string>
5454
<string>com.apple.xml-property-list</string>
55+
<string>com.autoit.au3</string>
5556
<string>com.barebones.bbedit.go-source</string>
5657
<string>com.barebones.bbedit.ini-configuration</string>
5758
<string>com.barebones.bbedit.jsp-source</string>
@@ -90,6 +91,7 @@
9091
<string>com.sas.source</string>
9192
<string>com.sass-lang.sass</string>
9293
<string>com.sequel-ace.sequel-ace.sql</string>
94+
<string>com.stata.source</string>
9395
<string>com.sun.java-properties</string>
9496
<string>com.sun.java-source</string>
9597
<string>com.sun.java-server-pages</string>
@@ -140,6 +142,7 @@
140142
<string>org.iso.sql</string>
141143
<string>org.julialang.julia</string>
142144
<string>org.json.jsonc</string>
145+
<string>org.jsonlines.jsonl</string>
143146
<string>org.khronos.gltf</string>
144147
<string>org.kmt.source</string>
145148
<string>org.km3</string>
@@ -348,6 +351,10 @@
348351
<string>dyn.ah62d4rv4ge81g2phqy</string>
349352
<string>dyn.ah62d4rv4ge80g6u</string>
350353
<string>dyn.ah62d4rv4ge8063u</string>
354+
<string>dyn.ah62d4rv4ge80c3dt</string>
355+
<string>dyn.ah62d4rv4ge80k52</string>
356+
<string>dyn.ah62d4rv4ge80y65tr30a</string>
357+
<string>dyn.ah62d4rv4ge80c7mx</string>
351358
</array>
352359
<key>QLSupportsSearchableItems</key>
353360
<false/>
@@ -358,6 +365,6 @@
358365
<string>$(PRODUCT_MODULE_NAME).PreviewViewController</string>
359366
</dict>
360367
<key>NSHumanReadableCopyright</key>
361-
<string>Developed by SBAREX (2019-2022).</string>
368+
<string>Developed by SBAREX (2019-2023).</string>
362369
</dict>
363370
</plist>

0 commit comments

Comments
 (0)