fix: update pygmentize flags in glance subcommand (#488)

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
vladislav doster 2023-03-26 02:03:42 -05:00 committed by GitHub
parent 824d9d3617
commit b773763bdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -765,6 +765,7 @@ Has 39 line(s). Calls functions:
.zinit-glance
|-- zinit-side.zsh/.zinit-exists-physically-message
|-- zinit-side.zsh/.zinit-first
|-- zinit.zsh/+zinit-message
`-- zinit.zsh/.zinit-any-to-user-plugin
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).

View file

@ -189,6 +189,7 @@ Called by:
zinit-autoload.zsh/.zinit-cd
zinit-autoload.zsh/.zinit-confirm
zinit-autoload.zsh/.zinit-delete
zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/.zinit-self-update
zinit-autoload.zsh/.zinit-show-zstatus
zinit-autoload.zsh/.zinit-uninstall-completions

View file

@ -3048,7 +3048,7 @@ EOF
.zinit-exists-physically-message "$user" "$plugin" || return 1
.zinit-first "$1" "$2" || {
builtin print "${ZINIT[col-error]}No source file found, cannot glance${ZINIT[col-rst]}"
+zinit-message '{log-err} No source file found, cannot glance'
return 1
}
@ -3059,17 +3059,17 @@ EOF
{
if (( ${+commands[pygmentize]} )); then
builtin print "Glancing with ${ZINIT[col-info]}pygmentize${ZINIT[col-rst]}"
pygmentize -l bash -g "$fname"
+zinit-message "{log-info} Inspecting via {cmd}pygmentize{rst}"
pygmentize -l 'bash' "$fname"
elif (( ${+commands[highlight]} )); then
builtin print "Glancing with ${ZINIT[col-info]}highlight${ZINIT[col-rst]}"
+zinit-message "{log-info} Inspecting via {cmd}highlight{rst}"
if (( has_256_colors )); then
highlight -q --force -S sh -O xterm256 "$fname"
highlight --force --output-format xterm256 --quiet --syntax sh "$fname"
else
highlight -q --force -S sh -O ansi "$fname"
highlight --force --output-format ansi --quiet --syntax sh "$fname"
fi
elif (( ${+commands[source-highlight]} )); then
builtin print "Glancing with ${ZINIT[col-info]}source-highlight${ZINIT[col-rst]}"
+zinit-message "{log-info} Inspecting via {cmd}source-highlight{rst}"
source-highlight -fesc --failsafe -s zsh -o STDOUT -i "$fname"
else
cat "$fname"