Commit Graph

9357 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
53355885c8 Clean up dead code in builtin_read.cpp 2019-01-16 15:44:10 -06:00
Mahmoud Al-Qudsi
333bf1fd9f Remove write-only desc_width local variable 2019-01-16 15:38:27 -06:00
Mahmoud Al-Qudsi
bad3c5d79d Remove dead assignment and clarify ENV_NOT_FOUND behavior for set -e 2019-01-16 15:27:23 -06:00
Aaron Gyes
fb74ccb1f2 set's color completions: remove Color description.
On `set fish_color_cwd <TAB>`, a bunch of named colors are
shown in the pager. Each and every one has a description of "Color".

These are all very obviously colors, and none are not colors,
the description does not tell us anything specific about the item.

Descriptions in situations like this are actually a hinderance
because of the way they cause less to fit into the pager. Remove it
2019-01-16 10:34:16 -08:00
Fabian Homborg
de32665939 tests/invocation: Disable set -e
There's just waaayy too many things that could go wrong with it, so it
annoys more than it helps, especially since we don't get any
indication what failed.

E.g. on FreeBSD, the test failed without a usable message just because
`tput` couldn't find an attribute (so colors were unset).
2019-01-16 12:01:00 +01:00
Fabian Homborg
6c1a2c1f30 tests: Don't use mktemp -u
This works around a bug on FreeBSD 11.
2019-01-16 12:01:00 +01:00
Fabian Homborg
5779d99a81 fish_vi_cursor: Check for tput before using
If tput isn't available, that's the same as if it failed.

This is the last bit necessary to make the tests work on alpine on builds.sr.ht.
2019-01-16 11:08:47 +01:00
Fabian Homborg
c9fe59237b webconfig: Allow \co sgr0 in one more place
Some $TERMs like tmux and linux use an sgr0 ("reset") value that ends
in \co instead of "m". We need to adjust our regex here to catch that,
or we'd miscount lines with it.
2019-01-16 10:23:53 +01:00
Fabian Homborg
d7dac4d077 webconfig: Use history -z
This did some weird stuff with \x1e.

[ci skip]
2019-01-16 09:32:26 +01:00
Fabian Homborg
2b426c1047 webconfig: Fix binding tab
This broke when --preset was introduced.

We allow a "--preset" or "--user" to appear right after the "bind",
and save the value, but don't use it yet.

Fixes #5534.

[ci skip]
2019-01-16 09:32:26 +01:00
Aaron Gyes
2abd0cde85 builtin_printf.cpp: remove is_hex_digit, redo is_octal_digit
Our is_hex_digit() was redundant, we can just use iswxdigit; the libc
implementation is a more efficient table lookup anyhow.

Do is_octal_digit() in terms of iswdigit instead of using wcschr.
2019-01-15 02:05:12 -08:00
Aaron Gyes
c94adb9d3e fish_config: make clear python 2 or 3 will both work.
A person stuck installing it just for fish on their server
doesn't want to waste time installing the wrong one, so assuage that.

Also tweak to look nicer with 80 columns
2019-01-14 03:29:57 -08:00
Aaron Gyes
7d16714dd3 fish_config: tell the user some nice things without Python
As discussed in #5492, it would be good if running fish_config without
Python actually told the user to install Python.

Further, let's give the person some hints on how to configure these
things by hand, since they may have to.
2019-01-14 03:08:44 -08:00
Mahmoud Al-Qudsi
03cdf89bfd Add tests for $status after while in various scenarios
Includes a regression test for #5513 and asserts the behavior defined in
\#4982.
2019-01-13 18:58:48 -06:00
Mahmoud Al-Qudsi
027fc43736 Fix result after explicit return in a while block
Closes #5513.
2019-01-13 18:56:19 -06:00
Mahmoud Al-Qudsi
2fdcc4544a Fix extra space in fish_title
Closes #5517. Credit goes to @jadenPete.

[skip-ci]
2019-01-13 16:14:58 -06:00
Fabian Homborg
6d11e46428 completions/git: Also don't use files for porcelain=2
This was an oversight from the previous commit. Not that it matters
much, because we already removed $files.

Still, this would fail if someone defined a global $files, so let's fix it.

[ci skip]
2019-01-13 21:33:00 +01:00
Fabian Homborg
787f453ec2 completions/git: Skip "!" shell-aliases for wrapping
We can't complete these, and now the user can do

```
set -g __fish_git_alias_$alias $command
```

e.g.

```
set -g __fish_git_alias_co checkout
```

if the arguments in the alias end up going to `git alias`.

Fixes #5412.

[ci skip]
2019-01-13 17:20:10 +01:00
Fabian Homborg
73bae383e0 completions/git: Stop limiting to the token
This enables fuzzy-matching outside of the current directory again.

As it turns out, the performance impact here isn't as large as I
thought - it's massively dependent on caching.

Fixes #5476.
2019-01-13 17:05:05 +01:00
Fabian Homborg
de145477be Remove bc from travis.yml
This should be the last mention of it, according to `git grep`.
2019-01-13 16:32:56 +01:00
Dror Levin
db1d694aec Remove bc from Dockerfile
As math is now a builtin bc is no longer required.
2019-01-13 18:29:15 +08:00
ridiculousfish
2d3e8ec0a9 Correct highlighting of abbreviations
Abbreviation highlighting cannot use the snapshot environment because we do
not know up-front which variables to capture. Will revisit this later.
2019-01-11 20:43:52 -08:00
ridiculousfish
82170b0862 Add HOME as a snapshotted variable
Corrects certain autosuggestions involving tildes.
2019-01-11 15:12:17 -08:00
ridiculousfish
59d62fdd53 Thread the right PWD through autosuggestions
These were getting / as the PWD, resulting in bogus suggestions.
2019-01-11 15:04:09 -08:00
David Adam
455959ae7a fish.spec: run tests with SHOW_INTERACTIVE_LOG=1 2019-01-12 00:06:27 +08:00
Aaron Gyes
6c9065e9ef abbr -e: use same exit code as set -e if abbr doesn't exist
Which is 4, apparently.. (builtin_set.cpp returns ENV_NOT_FOUND)
here. This was previously hardcoded to our 121, which used to be
what builtins used for invalid arguments.

4 is pretty arbitrary but at least this is more consistent.
2019-01-11 00:50:01 -08:00
Mahmoud Al-Qudsi
6ea7aa8a00 Share code between yarn and npm completions
I had previously introduced a lot of updates and fixes to npm registry
based completions for `yarn` but hadn't ported them to `npm` as well
(although they can be dropped in as-is). This patch shares the code
between the two, which resides in an explicitly sourced multi-function
fish script.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
56cedac3b5 Show info about all-the-package-names helper for yarn/npm completions
The informational message is only shown the first time an attempt at
completing `yarn add` is made per session. This should vastly improve
the discoverability of this feature as regular yarn/npm users would
never have `all-the-package-names` installed normally.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
848ca1c1cc Improve UX by not providing yarn completions if no input
Otherwise, the interface would hang while fish processed the output of
`all-the-package-names` and then would ultimately not show any results
anyhow.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
34e104ca35 Allow more flexibility with file completions for yarn
Closes #5502
2019-01-10 23:12:49 -06:00
ridiculousfish
a333c2f01d Fix some compile warnings 2019-01-10 20:59:47 -08:00
ridiculousfish
92d3f5f548 Merge branch 'instance_env'
This merges a bunch of changes that eliminate fish variables as a global
concept. Instead fish variables are tied to an instance of environment_t
(read-only) or env_stack_t (read/write), which is explicitly threaded
through every site. This is nice cleanup and also preparation for
concurrent execution, where multiple independent threads may need to see
different variables.
2019-01-10 20:50:38 -08:00
ridiculousfish
77884bc21a Instantize env_get
This removes env_get(). All fish variable accesses must go through an
environment_t.
2019-01-10 20:08:06 -08:00
ridiculousfish
b98812dd1a Remove last vestiges of env_set 2019-01-10 20:07:58 -08:00
ridiculousfish
3b1709180f Instantize env_get 2019-01-10 20:07:53 -08:00
ridiculousfish
6f52e6bb1c Instantize contents of exec.cpp and others 2019-01-10 20:07:47 -08:00
ridiculousfish
038f3cca6d Remove the abbreviation cache
Read abbreviations directly from the environment.
2019-01-10 20:07:41 -08:00
ridiculousfish
9f62a53077 Instantize env_get inside highlighting 2019-01-10 20:07:35 -08:00
ridiculousfish
50c83463f1 Switch some uses of env_get to instanced environment_t 2019-01-10 20:07:31 -08:00
ridiculousfish
3eb15109cf Instantize env_set in env.h and env.cpp 2019-01-10 20:07:23 -08:00
ridiculousfish
abcd24f716 Eliminate env_snapshot_t::current()
These uses are better served by passing in the real environment stack,
now that we have environment_t as a shared base class.
2019-01-10 20:07:14 -08:00
ridiculousfish
03b92ffe00 Clean up path_get_cdpath and path_can_be_implicit_cd 2019-01-10 20:07:10 -08:00
ridiculousfish
c1dd284b3e Instantize env_set
Switch env_set to an instance method on environmnet_t.
2019-01-10 20:05:45 -08:00
ridiculousfish
421fbdd52a Instantize env_get_pwd_slash
This requires threading environment_t through many places, such as completions
and history. We introduce null_environment_t for when the environment isn't
important.
2019-01-10 20:01:28 -08:00
ridiculousfish
26fc705c07 Instance env_set_empty 2019-01-10 20:01:20 -08:00
ridiculousfish
a00de96a57 Instance env_remove 2019-01-10 20:01:15 -08:00
ridiculousfish
ede66ccaac Instance env_set_argv and env_set_pwd 2019-01-10 20:29:10 -08:00
ridiculousfish
5055621e02 Eliminate env_push and env_pop 2019-01-10 20:29:10 -08:00
ridiculousfish
94adb53b1f Eliminate complete_set_variable_names 2019-01-10 20:29:10 -08:00
ridiculousfish
e6b13c6bac Begin to thread environments explicitly through completions 2019-01-10 20:29:10 -08:00