From 06faf7bd2427f58b1419d12686e01d773b05a2ef Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Fri, 13 May 2016 07:41:54 +0200 Subject: [PATCH] 'main': main-highlighter can be run from command line --- highlighters/main/parse.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 highlighters/main/parse.zsh diff --git a/highlighters/main/parse.zsh b/highlighters/main/parse.zsh new file mode 100755 index 0000000..91db038 --- /dev/null +++ b/highlighters/main/parse.zsh @@ -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