'main': main-highlighter can be run from command line

This commit is contained in:
Sebastian Gniazdowski 2016-05-13 07:41:54 +02:00
parent 2176692704
commit 06faf7bd24

16
highlighters/main/parse.zsh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/zsh
source "../../zsh-syntax-highlighting.zsh"
if [ -n "$1" ]; then
# Load from given file
PREBUFFER=""
BUFFER="$(<$1)"
_zsh_highlight_main_highlighter
# This output can be diffed to detect changes in operation
print -rl -- "${region_highlight[@]}"
else
echo "Usage: ./parse.zsh {file}"
fi