2c2187b09d6dc488bb67968748ec07f7235a0238

Author
cxy004 <cxy004@qq.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(macos): fix `man-preview` for macOS Ventura (#11324)

Diff

 1diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh
 2index b540eecb5ff8573c82b0d2287cbfd85d272678a4..e4d759dcfaa0cd5c13ceea9a05575872318100dd 100644
 3--- a/plugins/macos/macos.plugin.zsh
 4+++ b/plugins/macos/macos.plugin.zsh
 5@@ -224,8 +224,9 @@ function quick-look() {
 6 }
 7 
 8 function man-preview() {
 9+  local location
10   # Don't let Preview.app steal focus if the man page doesn't exist
11-  man -w "$@" &>/dev/null && man -t "$@" | open -f -a Preview || man "$@"
12+  location=$(man -w "$@") && mandoc -Tpdf $location | open -f -a Preview
13 }
14 compdef _man man-preview
15