Permalink
Commits on Sep 21, 2017
  1. Use \uXXXX consistently for unicode code points

    krader1961 committed Sep 21, 2017
    A recent discussion involving whether `can_be_encoded()` was broken
    caused me to notice that we are inconsistent about whether Unicode code
    points are specified using `\xXXXX` or `\uXXXX` notation. Which is
    harmless but silly and potentially confusing.
Commits on Sep 16, 2017
  1. Drop deprecated `history search --with-time` flag (#4403)

    krader1961 authored and ridiculousfish committed Sep 16, 2017
    This flag was only documented for a few weeks before being renamed
    `--show-time` and has been deprecated for a long time. Fish 3.0 is a good
    opportunity to remove it.
Commits on Sep 15, 2017
  1. mplement `history search` glob searches

    krader1961 committed Sep 15, 2017
    Instead of treating the search term as a literal string to be matched
    treat it as a glob. This allows the user to get a more useful set of
    results by using the `*` glob character in the search term.
    
    Partial fix for #3136
Commits on Sep 14, 2017
  1. Implement `history search --reverse` (#4375)

    krader1961 authored and floam committed Sep 14, 2017
    * 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()
Commits on Sep 11, 2017
Commits on Sep 9, 2017
  1. Hoist `for` loop control var to enclosing scope (#4376)

    krader1961 authored and ridiculousfish committed Sep 9, 2017
    * 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
Commits on Aug 26, 2017
  1. Fix indexing of $history

    krader1961 authored and mqudsi committed Aug 25, 2017
    cherry-picked from krader1961/fish-shell commit b69df4fe72
    
    Fixes #4353 (regression in indexing of history contents) and introduces
    new unit tests to catch bad $history indexing in the future.
Commits on Aug 24, 2017
  1. Switch to bare vars in our `math` invocations

    krader1961 committed Aug 24, 2017
    Using bare vars is more efficient because it makes the builtin `math`
    expression cache more useful. That's because if you prefix each var with
    a dollar-sign then the fish parser expands it before `math` is run.
    Something like `math x + 1` can be cached since the expression is the
    same each time it is run. But if you do `math $x + 1` and x==1 then you're
    effectively executing `math 1 + 1`. And if x==2 the next time then you're
    running `math 2 + 1`. Which makes the expression cache much less effective.
  2. Cache math expressions

    krader1961 committed Aug 24, 2017
    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.
  3. Implement support for bare vars by `math`

    krader1961 committed Aug 24, 2017
    This change allows you to type `math x + 3` rather than `math $x + 3`.
    
    Another step to resolving issue #3157.
  4. Make builtin `math` the default implementation

    krader1961 committed Aug 24, 2017
    Remove our `math` function that wraps `bc`. Our math builtin is now good
    enough that it can be the default implementation.
    
    Another step in resolving #3157.
  5. Change how `math` rounds integer results

    krader1961 committed Aug 24, 2017
    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.
  6. Implement support for multiple math expressions

    krader1961 committed Aug 24, 2017
    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')
Commits on Aug 23, 2017
  1. Implement bare minimum builtin `math` command

    krader1961 committed Aug 23, 2017
    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.
  2. Check-in MuParser source

    krader1961 committed Aug 22, 2017
    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.
Commits on Aug 20, 2017
  1. Report error when using read-only var in for loop

    krader1961 committed Aug 20, 2017
    Using a read-only variable like `status` as a for loop control variable
    has never worked. But without this change you simply get non-sensical
    behavior that leaves you scratching your head in puzzlement. This change
    replaces the non-sensical behavior with an explicit error message.
    
    Fixes #4342
  2. Actually flip the order of the interpolated values

    krader1961 committed Aug 20, 2017
    The previous commit was a no-op. Fix it.
  3. Make argparse error message deterministic

    krader1961 committed Aug 20, 2017
    Recent changes to switch to unordered sets/maps can cause the order in
    which items are returned to be non-deterministic. This change ensures
    that the argparse "Mutually exclusive flags" error message to be
    deterministic with respect to the order of the interpolated values.
  4. Another fish var performance improvement

    krader1961 committed Aug 19, 2017
    Make setting fish vars more efficient by avoiding creating a
    wcstring_list_t for the case where we're setting one value. For the case
    where we're passing a list of values swap it with the list in the var
    rather than copying it. This makes the benchmark in #4200 approximately
    6% faster.
Commits on Aug 19, 2017
  1. Reduce overhead of setting fish vars

    krader1961 committed Aug 19, 2017
    The `react_to_variable_change()` function is called whenever a fish var
    is set. Even as a consequence of statements like `for x in a b c`. It is
    therefore critical that that function be as fast as possible. Especially
    when setting the var doesn't have any side-effects which is true something
    like 99.9999% of the time.
    
    This change reduces the overhead of `react_to_variable_change()` to
    unmeasurable levels. Making the synthetic benchmark in issue #4341
    36% faster.
    
    Fixes #4341
Commits on Aug 18, 2017
  1. change env_var_t to a vector of strings

    krader1961 committed Aug 5, 2017
    Internally fish should store vars as a vector of elements. The current
    flat string representation is a holdover from when the code was written
    in C.
    
    Fixes #4200
Commits on Aug 17, 2017
  1. Update changelog

    krader1961 committed Aug 17, 2017
Commits on Aug 16, 2017
  1. fix `set --show` of semi-empty var

    krader1961 committed Aug 16, 2017
    A semi-empty var is one with a single empty string element. The
    `env_var_t::empty()` method returns true for such vars but we want
    `set --show` to report that it has a single empty element.
  2. fix `set --show` of semi-empty var

    krader1961 committed Aug 16, 2017
    A semi-empty var is one with a single empty string element. The
    `env_var_t::empty()` method returns true for such vars but we want
    `set --show` to report that it has a single empty element.
Commits on Aug 15, 2017
  1. Enable support for custom versioning

    krader1961 committed Aug 15, 2017
    Now that we're working on the 3.0.0 major release it is more important
    than ever that fish binaries built by developers have version strings
    which clearly communicate where they came from.
  2. Enable support for custom versioning

    krader1961 committed Aug 15, 2017
    Now that we're working on the 3.0.0 major release it is more important
    than ever that fish binaries built by developers have version strings
    which clearly communicate where they came from.