diff --git a/share/functions/__fish_man_page.fish b/share/functions/__fish_man_page.fish index ef2bee562..5c8e17ec7 100644 --- a/share/functions/__fish_man_page.fish +++ b/share/functions/__fish_man_page.fish @@ -1,6 +1,6 @@ function __fish_man_page - # Get all commandline tokens not starting with "-" - set -l args (commandline -po | string match -rv '^-') + # Get all commandline tokens not starting with "-", up to and including the cursor's + set -l args (string match -rv '^-|^$' -- (commandline -cpo && commandline -t)) # If commandline is empty, exit. if not set -q args[1]