__fish_complete_man.fish: escape for regex

Previously, using special regex characters or slashes would result in an
error message, when pressing tab in a command-line such as
"man /usr/bin/time ".
This commit is contained in:
Johannes Altmanninger 2019-01-22 01:12:57 +01:00 committed by Fabian Homborg
parent 71b5591f21
commit eee4dd8248

View file

@ -10,7 +10,8 @@ function __fish_complete_man
case '-**'
case '*'
set section $prev[1]
set section (string escape --style=regex $prev[1])
set section (string replace --all / \\/ $section)
end
set -e prev[1]
end