Commit graph

8283 commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
1fbf810946 Unify ellipsis_str[ing] with common variable set once 2018-03-09 14:40:35 -06:00
Mahmoud Al-Qudsi
3314135cc9 Move fixed test outside of input_mapping_is_match loop
The 0th index of the array was tested inside the loop instead of just
once outside it.

Also explain `input_mapping_is_match` control code behavior and
reasoning and simplify control flow.
2018-03-09 14:11:43 -06:00
Mahmoud Al-Qudsi
efb894fdae Fix read tests to reflect updated arguments 2018-03-09 12:19:20 -06:00
Mahmoud Al-Qudsi
ff20651d8b Clean up CHANGELOG.md with regards to read arguments
Removed misleading statement about read requiring an argument, as the
note about read's new behavior when no arguments are provided covers
that and is less confusing.
2018-03-09 12:07:09 -06:00
Mahmoud Al-Qudsi
9206734a4d Merge branch 'issue_4490' (read --silent/-s)
Closes #4490
2018-03-09 12:06:31 -06:00
Mahmoud Al-Qudsi
8b9a13f6ca Update read builtin documentation to reflect --shell and --silent opt changes 2018-03-09 12:03:45 -06:00
Mahmoud Al-Qudsi
eaa5958b77 Update completions for read builtin
Change short option for `--shell` to `-S` per #4490 and add description for -s/--silent
2018-03-09 11:59:50 -06:00
Mahmoud Al-Qudsi
2a266c4d48 Update fish's only usage of read -s to use read --shell instead 2018-03-09 11:55:12 -06:00
Mahmoud Al-Qudsi
f8ec1e4a7b Document `read -s/--silent and -S/--shell change 2018-03-09 11:53:19 -06:00
Mahmoud Al-Qudsi
86362e72fe Emit deprecation error when read -i is used for --silent 2018-03-09 11:48:51 -06:00
Mahmoud Al-Qudsi
db8ec59ac4 Change read to use -s/--silent and -S/--shell
Closes #4490
2018-03-09 11:48:20 -06:00
Mahmoud Al-Qudsi
b38ac1e35d Fix wait test with no process expansion 2018-03-09 10:50:43 -06:00
Mahmoud Al-Qudsi
a6f79dcca8 Implement -s for fish_vi_key_bindings
In similar vein to how fish_default_key_bindings works, parameters
passed to the function are automatically passed to bind upstream.
Additionally, -s is automatically added if no parameters had been
specified to prevent startup error messages. See 46d1334.

Closes #4494
2018-03-09 09:29:25 -06:00
Mahmoud Al-Qudsi
0866653a87 Merge branch 'no_percent'
Drops the % notation for process expansion. The existing notation was a
mess and expanded jobs, process ids, and process names via dark magic.
With this change, % is no longer a special character and can be used
unescaped with impunity.

The variables %self and %last, referring to fish's own pid and the pid
of the last backgrounded job respectively, have been replaced with $pid
and $last_pid. These are read-only variables, protected against being
redefined by the user.

Author's note: I would have personally preferred $fish_pid instead of
$pid but since we debated changing $version to $fish_version and then
reverted that change (with much acrimony), it makes no sense to break
with that precedent here. Additionally, $fish_last_pid is quite wordy.

Closes #4230. Closes #1202.
2018-03-09 09:16:31 -06:00
Mahmoud Al-Qudsi
827b8b9fd5 Document removal of % expansion and new $self/$last_pid variables 2018-03-09 09:15:29 -06:00
Mahmoud Al-Qudsi
26cc112096 Implement $last_pid, taking the place of %last
Set as a global variable upon the execution of a background job.
2018-03-09 08:56:13 -06:00
Mahmoud Al-Qudsi
f7e0cbc7a4 Drop % test for illegal commands
% is perfectly valid in commands, now :)
2018-03-09 04:02:29 -06:00
Mahmoud Al-Qudsi
b236ab6e5d Update %self references with $pid instead 2018-03-09 03:56:19 -06:00
Mahmoud Al-Qudsi
90d0f91bcd Define read-only $pid as %self replacement 2018-03-09 03:47:32 -06:00
Mahmoud Al-Qudsi
f42f7b7208 Clean up detritus of process expansion 2018-03-09 03:39:53 -06:00
Mahmoud Al-Qudsi
e45e2bf20e Initial removal of '%' syntax for process/job expansion 2018-03-09 03:36:10 -06:00
Patrick Häcker
9616b50461 Improve documentation of cartesian product with empty expansion (#4769)
* Improve documentation of cartesian product with empty expansion

* Fix review findings for documentation of empty cartesian product expansion
2018-03-08 22:42:32 +01:00
Samuel Gagnon
f02dd22973 Typo in documentation for "emit" command
Line \endfish is misplaced.
2018-03-08 12:55:35 +01:00
George Christou
73f2b444ef completions: [git] Do not decorate reflog 2018-03-07 22:01:23 +01:00
Fabian Homborg
2d08b5ee8a [math] Add tests for runtime errors
And fix "isinfinite" - it's called "isinf".
2018-03-07 18:13:26 +01:00
Fabian Homborg
9fc3d1215b [math] Check for runtime errors
When number is infinite, not a number, larger than LONG_MAX or smaller
than LONG_MIN, print a corresponding error and return STATUS_CMD_ERROR.

This should fix the worst of the problems, by at least making them clear.

Fixes #4479.
Fixes #4768.
2018-03-07 18:03:44 +01:00
Fabian Homborg
98d29b53de Refresh winsize before printing prompt
This allows prompts to react to $COLUMNS by e.g. omitting some parts.

We still fallback to a ">" prompt if that's still not short enough,
but now the user has a way of making a nicer prompt.

Fixes #904.
Fixes #4381.
2018-03-07 17:46:48 +01:00
Mahmoud Al-Qudsi
b50541c655 Add comment about checking if jq exists in a future update to yarn completions 2018-03-06 17:03:15 -06:00
Fabian Homborg
88cf7e16c6 [git completions] Sort tags newest-first
This has the nice effect of sorting "2.7.0" before "2.7b1".
2018-03-06 22:06:39 +01:00
Fabian Homborg
5cb3918c1c [git completions] Remove unnecessary helper function 2018-03-06 22:06:39 +01:00
Fabian Homborg
f3c864a9e2 [git completions] Offer unmerged files for add
These occur e.g. when resolving a conflict, which then needs `git add`.
2018-03-06 22:06:39 +01:00
Fabian Homborg
b24971dc9e [git completions] Only offer files for log --
After a "--" separator, `git log` only takes files.
2018-03-06 22:06:39 +01:00
Fabian Homborg
754b52bb26 [git completions] Make branches work on git 2.7.0 again
This used the "--format" option, which was only added in git 2.13.0.
2018-03-06 22:06:39 +01:00
Cesar Andreu
3792fb086a Fix man autocomplete when a section is set 2018-03-06 20:50:20 +01:00
Mahmoud Al-Qudsi
4414d5c888 Block custom/user completions for all invalid heads
If the head is not a valid, existent command, do not load and run custom
completion sources. This applies to both the autosuggestion provider and
manual user completions. File-based completions will still be offered.

Supersedes #4782 and #4783. Closes #4783. Closes #4782. Closes #2365.
2018-03-06 12:52:42 -06:00
Mahmoud Al-Qudsi
3c895c2839 Add whitespace helpers to complete.h/cpp 2018-03-06 12:52:42 -06:00
Fabian Homborg
93209ab053 Fix termux path
This is "/data/data/com.termux/files/usr/etc", not just ".../files/etc".
2018-03-06 17:55:25 +01:00
Fabian Homborg
e7f8e58be9 Add more ssh known_hosts paths
Fixes #4759.
2018-03-06 15:27:34 +01:00
ridiculousfish
3b2de931cd Simplify tokenize_variable_array() 2018-03-05 22:05:05 -08:00
ridiculousfish
37e748ad54 Remove an unused type 2018-03-05 21:58:22 -08:00
ridiculousfish
014b91488d Merge branch 'andand_oror_exclam'
This merges support for && || !

Fixes #4620
2018-03-05 14:14:34 -08:00
ridiculousfish
0938c9f427 Document && and || 2018-03-05 14:05:37 -08:00
ridiculousfish
9bb2d1e79f Note support for && || ! in CHANGELOG 2018-03-05 14:05:35 -08:00
ridiculousfish
c7f16439bf Add support for ! as an analog to 'not'
! and not are effectively interchangeable now.
Mark them both as operators for syntax highlighting.
2018-03-05 14:04:49 -08:00
ridiculousfish
f83742d579 Highlight && and || as operators
This also switches 'and' and 'or' to operators as well.
2018-03-05 13:51:05 -08:00
ridiculousfish
357d3b8c6d Rework 'and' and 'or' to be "job decorators"
This promotes "and" and "or" from a type of statement to "job
decorators," as a possible prefix on a job. The point is to rationalize
how they interact with && and ||.

In the new world 'and' and 'or' apply to a entire job conjunction, i.e.
they have "lower precedence." Example:

if [ $age -ge 0 ] && [ $age -le 18 ]
   or [ $age -ge 75 ] && [ $age -le 100 ]
   echo "Child or senior"
end
2018-03-05 13:41:36 -08:00
ridiculousfish
e1dafeab01 Add && and || support to the conditions of if and while
This updates the "boolean tail" feature of the if and while conditions
to know about job_conjunction, thereby respecting && and ||
2018-03-05 13:39:36 -08:00
ridiculousfish
8e9670ccd5 Implement execution of && and ||
This adds support for basic constructs. if and while is not yet
supported.
2018-03-05 12:20:56 -08:00
ridiculousfish
23d4f93556 Add && and || to fish grammar
This teaches the parser about && and ||, implemented via a new
production "job_conjunction".

These do not yet have execution support.
2018-03-05 12:20:56 -08:00
ridiculousfish
8ded041352 Add && and || support to tokenizer 2018-03-05 12:20:56 -08:00