mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-20 10:15:31 +08:00
17 lines
330 B
Bash
17 lines
330 B
Bash
![]() |
#!/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
|