Allows `fish_indent -w **.fish` to restyle all fish files under the
current directory.
(This also has the sideeffect of reducing style.fish time by ~10s, as
we only need to invoke `fish_indent` once, instead of once per-file)
Brace expansion with single words in it is quite useless - `HEAD@{0}`
expanding to `HEAD@0` breaks git.
So we complicate the rule slightly - if there is no variable expansion
or "," inside of braces, they are just treated as literal braces.
Note that this is technically backwards-incompatible, because
echo foo{0}
will now print `foo{0}` instead of `foo0`. However that's a
technicality because the braces were literally useless in that case.
Our tests needed to be adjusted, but that's because they are meant to
exercise this in weird ways.
I don't believe this will break any code in practice.
Fixes#5869.
We previously checked if fish_mode_prompt existed as a function, but
that's a bad change for those who already set it to an empty function
to have a mode display elsewhere.
We were flip-flopping between the two terms, so we now use one. We
still mention "array" in the chapter, and it's still `read --array`,
though.
Fixes#5846.
[ci skip]
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python.
If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
fish_indent_lexer formats lines not starting with a prompt indicator
as output, as long as there is a prompt indicator elsewhere.
So these tags are useless and wrong.
See #5696.
[ci skip]
This keeps all unknown options in $argv, so
```fish
argparse -i a/alpha -- -a banana -o val -w
```
results in $_flag_a set to banana, and $argv set to `-o val -w`.
This allows users to use multiple argparse passes, or to simply avoid
specifying all options e.g. in completions - `systemctl` has 46 of
them, most not having any effect on the completions.
Fixes#5367.
Universal newlines behaves differently between Python 2.7 and 3.x,
leading to problems when running Sphinx with Python 2.7.
fish_indent always uses \n, so there's no need to use universal newline
detection.
This also allows full UTF-8 in documentation sources.
Closes#5808.
This adds an option --print-rusage-self to the fish executable. When set,
this option prints some getrusage stats to the console in a human-readable
way. This will be used by upcoming benchmarking support.
There's an explicit label for "cartesian-product", but the title is
"Cartesian Product*s*". So linking via with `thing <#link>`_ links the
title, so without the "s" it doesn't work.
From what I know, linking via :ref:`thing <label>` is preferred and
works better with other exports and across files?
I think I should take a doc holiday.
[ci skip]
This adds a reference to one specific FAQ, so it adds a label for that
one question. It does not add the rest, because they currently aren't
linked. If you add a reference to an FAQ, you should add the label as
well.
[ci skip]
We don't refer to "readline functions" anywhere else, and "injecting"
them "into the reader" is an overly jargony way of expressing it that
only makes sense to someone familiar with the internals. And even then
the term "readline" is already taken by the "readline" library, used
by bash et al, but not by us.
So we pick the term "input functions", like we did in bind.
See https://stackoverflow.com/questions/55542839/what-does-commandline-f-repaint-in-fish-shell/55543411#55543411.
[ci skip]
If we switch the bind mode, we add a "force-repaint" there just to
redraw the mode indicator.
That's quite wasteful and annoying, considering that sometimes the prompt can take
half a second.
So we add a "repaint-mode" function that just reexecutes the
mode-prompt and uses the cached values for the others.
Fixes#5783.