Commit Graph

806 Commits

Author SHA1 Message Date
Michihito Shigemura
c5241360af Fix typo in history 2017-11-06 18:48:16 +01:00
Michihito Shigemura
f0503c84dc Improve document in FORMATTING
Update links
Fix typo
2017-11-06 18:46:57 +01:00
Michihito Shigemura
f0ce62c873 Fix typo in abbr 2017-11-03 14:09:22 +01:00
Michihito Shigemura
4a4fd7e75b Fix typo in faq 2017-11-03 14:08:48 +01:00
Michihito Shigemura
efdc62fa80 Fix typo in argparse 2017-11-03 14:08:24 +01:00
David Adam
9adb3492f9 docs: fish_history can be set to the empty string 2017-10-31 18:26:31 +08:00
David Adam
b34b0cf1e3 Restore previous output of status current-{filename,function}
Closes #4499.

Partial reversion of 30368d5526.
2017-10-31 18:10:46 +08:00
David Adam
7fe7582329 docs: move fish_history entry to correct section and reword 2017-10-31 17:53:16 +08:00
Aaron Gyes
a9283803d4 Revert "Non-exported vars: rename SHLVL to shlvl"
Duh, of course it is exported.

This reverts commit 5fc17dcc82.
2017-10-15 04:37:34 -07:00
Aaron Gyes
5fc17dcc82 Non-exported vars: rename SHLVL to shlvl
Fixes #4414
2017-10-15 04:33:27 -07:00
Aaron Gyes
0c1984eb6c Fix a grammer mistake in docs 2017-10-14 13:17:59 -07:00
Aaron Gyes
fb8ae04f80 Rename $FISH_VERSION back to the original $version.
Order is restored in the universe. Fixes #4414
2017-10-14 08:33:02 -07:00
Aaron Gyes
7be8a1707c Rename FISH_READ_BYTE_LIMIT to fish_read_limit
Fixes #4414
2017-10-14 08:33:02 -07:00
Aaron Gyes
18b06f3768 Rename CMD_DURATION to cmd_duration
Fixes #4414
2017-10-14 08:33:02 -07:00
Mahmoud Al-Qudsi
4780b28a93 Updated read docs to include new stdout behavior 2017-10-10 08:23:24 +02:00
Amitava Bhattacharyya
48797974d3 Remove extraneous reference in FAQ (#4459)
"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?"
2017-10-09 22:06:56 -07:00
Mahmoud Al-Qudsi
ff66d2f3c1 Add more test examples, including expression negation
Closes #4383
2017-10-08 02:06:48 +02:00
Mahmoud Al-Qudsi
f18b6868b7 Include --quiet in command builtin summary 2017-10-04 12:02:52 +02:00
Mahmoud Al-Qudsi
811beb9dcc Document new -s/--silent bind switch 2017-10-03 11:20:17 +02:00
David Adam
472e186c2b Rename FISH_HISTORY to fish_history
Work on #4414.
2017-09-24 14:07:45 +08:00
Ed Brannin
9ac7da28bd Fix smurf_color variable name 2017-09-16 07:02:34 +08:00
Kurtis Rader
ee1d310651 Implement history search --reverse (#4375)
* 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()
2017-09-14 15:44:17 -07:00
Kurtis Rader
905766fca2 Hoist for loop control var to enclosing scope (#4376)
* 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
2017-09-08 21:14:26 -07:00
Fabian Homborg
9347951158 Clarify string match without -r partial match
Fixes #4388.
2017-09-08 16:33:34 +02:00
David Adam
91a0ba9be5 Revert part of "Revert "Cache math expressions""
56d9134534 contained an LRU cache plus
changes to the documentation; 95162ef19d
reverted both.

This commit re-adds the documentation changes, which are still correct.
2017-09-01 21:55:50 +08:00
ridiculousfish
95162ef19d Revert "Cache math expressions"
This reverts commit 56d9134534.

An LRU cache in the shell for math seems like overkill.
2017-09-01 00:25:40 -07:00
Kurtis Rader
56d9134534 Cache math expressions
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.
2017-08-24 12:18:39 -07:00
Kurtis Rader
b816cd6d50 Change how math rounds integer results
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.
2017-08-23 17:31:04 -07:00
Kurtis Rader
24d251ff4b Implement support for multiple math expressions
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')
2017-08-23 17:14:54 -07:00
Kurtis Rader
41a7b9457c Implement bare minimum builtin math command
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.
2017-08-23 14:43:45 -07:00
Kurtis Rader
d247c121a2 Check-in MuParser source
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.
2017-08-23 14:43:45 -07:00
Phidica Veia
84b59ae0be Add vertical bar escape \| to documentation
Fixes #3794
2017-08-19 15:22:57 +08:00
Fabian Homborg
298c580e72 Clarify docs on $status with and/or/begin/end
See #4311.
2017-08-14 18:18:10 -07:00
David Adam
487dc98468 docs: update language in read documentation 2017-08-14 18:18:10 -07:00
David Adam
7b92217273 docs: improve set -Ux language and example
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.
2017-08-14 18:18:09 -07:00
David Adam
5e4d046492 docs: tidy language in set notes 2017-08-09 23:25:00 +08:00
Kurtis Rader
9d5a6c57a8 Merge branch 'master' into major 2017-08-06 20:53:51 -07:00
Elliott Beach
9fa0edcbc9 document bind behavior when mixing command types
Fixes 3683
2017-08-06 20:49:30 -07:00
Kurtis Rader
67de733b9b implement set --append and set --prepend
Fixes #1326
2017-08-04 17:23:24 -07:00
Kurtis Rader
38024a50dc backport set --show from fish 3.0
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.
2017-08-03 18:56:25 -07:00
Kurtis Rader
1aec66e8a1 document special value zero for FISH_READ_BYTE_LIMIT 2017-08-03 17:40:26 -07:00
Kurtis Rader
2bbcc5cbc8 document command substitution data limit 2017-08-03 17:40:25 -07:00
Kurtis Rader
e825415917 implement set --show
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
2017-08-03 15:49:52 -07:00
Kurtis Rader
17dff8c569 rewrite abbr function
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
2017-08-03 14:35:06 -07:00
Kurtis Rader
1a55e9ba60 Merge branch 'master' into major 2017-07-29 21:58:15 -07:00
Fabian Homborg
b1866b18dc Implement read --delimiter
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.
2017-07-28 12:15:46 +02:00
Mahmoud Al-Qudsi
94041974e4 Added option to use completion source order without re-sorting
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
2017-07-26 13:18:34 -07:00
Kurtis Rader
1278cf2b6e document need for double-quotes around test args 2017-07-25 17:04:59 -07:00
Kurtis Rader
8e2d165756 document need for double-quotes around test args 2017-07-25 17:04:41 -07:00
Kurtis Rader
6f46f6b45a refactor set builtin
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
2017-07-24 16:28:58 -07:00