Turns out "__fish_git_staged_files" does the same thing as "__fish_git_modified_files --staged".
Also use "--staged" instead of "--cached", which is a more
understandable synonym.
Many thanks to @thomcc on gitter.
Before this change, if a command failed, this was indicated by the "$"
at the end of the prompt turning red.
With this change in place, if a command fails, the exit code of the
failing command is displayed in [square brackets].
Running "cut" multiple times in a loop has an adverse performance
impact on first use, especially on slow systems. Using builtin "read"
for the same purpose is faster and cleaner.
for various completions.
This makes the code a bit nicer, removes one of the
__fish_print_hostnames calls (which are slow) and a sed call, thereby
improving performance by about 33% (600ms to 400ms).
Fixes#4511.
The previous hack used to work around an OS X issue/bug where launching
a URL with a #fragment appended would drop the fragment by using
`osascript` does not seem to work any more. Append the section name as a
query string (in addition to, not instead of #section) and then use some
basic javascript appended to the user doc HTML template to parse that
and jump to the correct section (if the section was dropped).
Closes#4480
fish was indiscriminately calling `rustc -Z help` in the autocompletion
script for `rustc`, but `-Z` (and its `-Z help` output completions) is
only available when using the nightly compiler.
Note that this isn't a perfect fix since if you try to use those command
line options now added to the autocompletions list without using the
nightly toolchain, `rustc` will still throw an error. But at least this
way we don't cause random errors about `-Z` not being available to
appear any time someone tries to use `rustc` from the fish command prompt.
E.g. if "foo" is in CDPATH, and both "foo/bar" and "./bar" exist, `cd
bar` will go to ./bar.
The completions described "bar" as going to "foo/bar" ("CDPATH foo").
This fixes it by checking for ./bar's existence.
See #4475.
\b does not match "end of spaces" but rather "start of a-z/0-9" and so
does not match the start of string '-c'. Match (and then re-insert) a
literal ' ' as part of the pattern instead.