File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/zsh
22
33# This code is licensed under the GPL v2. See LICENSE.txt for details.
4-
4+
55# colorize.sh
66# QLColorCode
77#
@@ -58,15 +58,24 @@ case $target in
5858 # look for a matlab-style comment in the first 10 lines, otherwise
5959 # assume objective-c. If you never use matlab or never use objc,
6060 # you might want to hardwire this one way or the other
61- if head -n 10 $target | grep -q " ^ *%" & > /dev/null; then
61+ if head -n 10 $target | grep -q " ^[ ] *%" & > /dev/null; then
6262 lang=m
6363 else
6464 lang=objc
6565 fi
6666 ;;
6767 * .groovy )
68- lang=java
69- ;;
68+ lang=java
69+ ;;
70+ * .pro )
71+ # Can be either IDL or Prolog. Prolog uses /* */ and % for comments.
72+ # IDL uses ;
73+ if head -n 10 $target | grep -q " ^[ ]*;" & > /dev/null; then
74+ lang=idlang
75+ else
76+ lang=pro
77+ fi
78+ ;;
7079 * )
7180 lang=${target##* .}
7281 ;;
You can’t perform that action at this time.
0 commit comments