Builtin 'set' now can set variable index ranges:
set test[1..3] a b c #works
set test[-1..-3] a b c #works if variable have enough elements
set test[2..-2] a b c #works
set test[1..3 -1..-2] a b c b b #works
Expand now can parse index ranges. But not handle for now.
TODO:
* Add variable substitution index ranges: echo $PATH[-1..1]
* Add command substitution index range: echo (seq 10)[-1..-4]
* Add process substitution indexes and ranges: echo %vim[-1]
Fish now doesn't join the fish_prompt output. This breaks the default
fish_prompt. Make default fish_prompt single-line. Fixes#203.
Add -l flag to 'read' documentation. Remove ambiguous '-x' description.
Fixes#157.
Remove the case statements, which were handled by the sed blocks anyway
Move around the '/' character in the regex, so only one regex is needed
Fix a bug where '/' is output as '//'
The following expression now works:
```sh
switch '\\'
case '\\'
echo 1
end
```
Due to ambiguity, the following expression also works:
```sh
switch '\a'
case '\\a'
echo 1
end
```
By the way, the following expression now doesn't work, which was not the
case before, because of wrong escaping:
```sh
switch 'nn'
case '\n'
echo 1
end
```
* case no properly handles -h and --help flags, i.e. treats it as
pattern
* fixed case escaping:
The following expressions now work correctly:
switch '*'
echo '*'
echo Match any string
end
switch '*'
echo '\*'
echo Match asterix
end
switch '\\'
echo '\\\\'
echo Match slash
end
The same for '?' sign
Autosuggestion will be automatically re-enabled next time a character is
inserted. An alternative implementation would require another command to
explicitly re-enable it.
Signed-off-by: Ian Munsie <darkstarsword@gmail.com>
This can be demonstrated with something like:
echo howdy hi<control-w>
echo howdy I<alt-b>
Previousely this would delete/move all the way to the start of 'howdy',
rather than just the word 'hi'/'I'.
It seems that the code to ignore the character under the cursor was
redundant, as all the cases I've tried with it removed seem to do the
right thing.
Signed-off-by: Ian Munsie <darkstarsword@gmail.com>
* Editor mode is no the default
* Use -i or --interactive or -e fish to edit function in interactive
mode
* tmpname is now created with random number added and check that file
do not already exist
* check $TMPDIR existence and put /tmp if it does not exist
* There is an undocumented feature to use functions, started with dash.
Introduce necessary changes to funced, functions, def_function()
in order to make it work properly.
* Delete editor guessing. Use $EDITOR variable or -e key
fish_pager_color_secondary to set background of every second completion
line. It simplifies finding the options corresponding to given
description. Default color is 151515.
With the switch bug fixed, __fish_git_prompt can be very slightly
simplified by not recording the exit status of every case in the
describe style switch individually.
The echo command to print the last path segment got a couplel of fixes,
but these fixes were only applied to the non-Darwin version. Copy these
fixes over to the Darwin version. Notably, this makes `/` stop
displaying as `//`.
When $PWD is "/private", the prompt was printing "rivate". Skip the
"/private" stripping if there's nothing after it.
Prevent "/private" from being stripped anywhere but the beginning of the
PWD.
Fixes#173
__fish_config_interactive.fish uses the presence of __fish_init_1_50_0
to decide whether it should perform a one-time initialization of
universal variables. Unfortunately, it sets the variable
__fish_init_1_23_0. Fix this to set __fish_init_1_50_0 instead.
__fish_git_prompt.fish is a complete port of the __git_ps1 function from
git-completion.bash, with the relevant configuration variables changed
and some extra configuration added (namely, control over individual
colors and the status indicator characters).
* Seems that writestr( L"\x1b];" ); doesn't work in tmux and
screen. As discussed in fish-shell/fish-shell#47 the 2 was
removed. This commit adds the zero (L"\x1b]0;").
* Tested in screen,tmux,iTerm and xterm.