"Use the fish_update_completions command.", the answer to "How do I update man page completions?", was also found at the end of the answer to "How do I get the exit status of a command?"
* Implement `history search --reverse`
It should be possible to have `history search` output ordered oldest to
newest like nearly every other shell including bash, ksh, zsh, and csh.
We can't make this the default because too many people expect the
current behavior. This simply makes it possible for people to define
their own abbreviations or functions that provide behavior they are
likely used to if they are transitioning to fish from another shell.
This also fixes a bug in the `history` function with respect to how it
handles the `-n` / `--max` flag.
Fixes#4354
* Fix comment for format_history_record()
* Hoist `for` loop control var to enclosing scope
It should be possible to reference the last value assigned to a `for`
loop control var when the loop terminates. This makes it easier to detect
if we broke out of the loop among other things. This change makes fish
`for` loops behave like most other shells.
Fixes#1935
* Remove redundant line
56d9134534 contained an LRU cache plus
changes to the documentation; 95162ef19d
reverted both.
This commit re-adds the documentation changes, which are still correct.
This implements an LRU cache of recently seen math expressions. When
executing math inside loops and the like this can provide a 33% decrease
in the time to execute the `math` command.
We need our `math` builtin to behave like `bc` with respect to rounding
floating point values to integer to avoid breaking to many existing
uses. So when scale is zero round down to the nearest integer.
Another change for #3157.
The MuParser supports the concept of multiple expressions separated by
commas. This implements support for that so that you can do things like
this:
set results (math '1+1, 4*2, 9^2')
This is the second baby step in resolving #3157. Implement a bare minimum
builtin `math` command. This is solely to ensure that fish can be built
and run in the Travis build environments. This is okay since anyone running
`builtin math` today is already getting an error response.
Also, more work is needed to support bare var references, multiple result
values, etc.
First step in fixing issue #3157 is to check-in the source code and hook
it into our build system.
The inclusion of the MuParser source adds the MIT License to those that
apply to fish. Update our documentation to reflect that fact.
The MuParser documentation is at
http://beltoforion.de/article.php?a=muparser. The source was downloaded
from https://github.com/beltoforion/muparser/releases. It is also hosted
on Github, https://github.com/beltoforion/muparser/. I did not download
it from Github because that source contained just a couple of cleanup
changes which don't affect its behavior.
By far the most common problem with universal variables being overridden
by global variables is other values being imported from the environment;
the `set -q; or set -gx` is much more of an edge case.
I decided this was just too useful not to include in our final fish 2.x
release. And since it does not modify any existing behavior it is safe
to include at this late date in the process of creating 2.7.
This adds a new capability to the `set` command. It is similar to
running `set` with no other arguments but provides far more detail about
each variable. Such as whether it is set in each of the local, global,
and universal scopes. And the values in each scope. You can also ask for
specific variables to be shown.
Fixes#4265
Rewrite the `abbr` function to store each abbreviation in a separate
variable. This greatly improves the efficiency. For the common case
it is 5x faster. For pathological cases it is upwards of 100x faster.
Most people should be able to unconditionally define abbreviations in
their config.fish without a noticable slow down.
Fixes#4048
This takes a string that is then split upon like `string split`.
Unlike $IFS, the string is used as one piece, not a set of characters.
There is still a fallback to IFS if no delimiter is given, that
behaves exactly as before.
Fixes#4156.
Introduce a -k/--keep-order switch to `complete` that can be used to
prevent fish from sorting/re-ordering the results provided by a completion
source.
In addition, this patch does so without doing away with deduplication
of completions by introducing a new unique_unsorted(..) helper function
that removes duplicates in-place without affecting the general order of
the vector/container.
Note that the code now uses a stable sort for completions, since the
behavior of is_naturally_less_than as of this patch now means that the
results are not necessarily _actually_ identical just because that function
repeatedly returns false for any ordering of any given two elements.
Fixes#361
This completes the refactoring of the `set` builtin. It also removes a
seemingly never used feature of the `set` command. It also eliminates all
the lint warnings about this module.
Fixes#4236