From 16050ab80e63f8e53c07777b4c2ae16ad085e5ad Mon Sep 17 00:00:00 2001 From: Richard Mitchell Date: Sun, 26 Feb 2023 16:40:44 -0500 Subject: feat(macos): allow multiple man pages in `man-preview` (#11365) --- plugins/macos/macos.plugin.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/macos/macos.plugin.zsh') diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index e4d759dcf..e27d412c8 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -224,9 +224,10 @@ function quick-look() { } function man-preview() { - local location - # Don't let Preview.app steal focus if the man page doesn't exist - location=$(man -w "$@") && mandoc -Tpdf $location | open -f -a Preview + local page + for page in "${(@f)"$(man -w $@)"}"; do + command mandoc -Tpdf $page | open -f -a Preview + done } compdef _man man-preview -- cgit v1.2.3-70-g09d2