Commit graph

12939 commits

Author SHA1 Message Date
Fabian Homborg
e8d725e051 Add tests for type
While we use `type -q` a bunch, the other options are kind of
unutilized, and so having a test is nice when we want to reimplement
it.

See #7342.
2020-09-20 10:36:17 +02:00
Fabian Homborg
7ec57f2c50 string: Handle unmatched capturing groups as empty
Instead of erroring out.

Fixes #7343.
2020-09-20 10:36:17 +02:00
ridiculousfish
5c3571d626 Revert accidental merge of #7340
This reverts back to commit d8e2cac83e.
I accidentally did a 'git push' during code review.
2020-09-19 19:31:44 -07:00
Andrew Prokhorenkov
32f8b0c531 docs: update "string pad" to "width" argument 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
2afa354c14 builtin_string: implement "width" argument for "string pad" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
bfa699c556 docs: update string doc 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
e8d9572b3e docs: remove quiet for "string pad" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
70dfece3ce builtin_string: remove quiet 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
7eccec3ce0 builtin_string: order "string_pad" before "string_replace" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
ac8482113c docs: string pad doc update 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
52b0d356ff builtin_string: remove redundant statements 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
efe94344e2 builtin_string: extra tests 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
2b9158ddab builtin_string: add "--max" for "string pad" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
b11d4c16b8 docs: fix rst formatting for "string pad" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
886290c123 builtin_string: change npad 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
f389bb0e97 tests: added tests for "string pad" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
c8e1894c72 builtin_string: add pad command 2020-09-19 19:25:57 -07:00
ridiculousfish
d8e2cac83e Reimplement vectorized reads for detecting ASCII strings
This is a reimplementation of the "vectorized" ASCII detection
from str2wcs_internal. This handles the case where only part of
a string is ASCII. It also avoids pointer overflow issues and improves
commenting.
2020-09-19 17:52:17 -07:00
ridiculousfish
4f0ade7a73 Optimize str2wcs_internal more
Prior to this change, str2wcs_internal had an optimization for ASCII
inputs. However the main cost was the repeated bounds checks when
performing push_back() on the resulting wcstring.

Switch to determining the number of ASCII characters, and then appending
those all in one go. This improves the time in the 'convert_ascii' test
from ~450 usec to ~75 usec.
2020-09-19 17:47:14 -07:00
ridiculousfish
4d5d90d828 Add a simple ASCII conversion test and benchmark
Run `fish_tests perf_convert_ascii` to run the benchmark.
2020-09-19 17:47:12 -07:00
Fabian Homborg
a3e20a4d38 Don't use abbreviated long options
"function --argument" is not a thing, it's "--argument-names". This only
accidentally works because our getopt is awful and allows abbreviated
long options.

Similarly, one argparse test used "--d" instead of "-d" or "--def".
2020-09-19 11:47:41 +02:00
Fabian Homborg
21077c0c9a CHANGELOG A few rewordings
[ci skip]
2020-09-18 22:18:03 +02:00
exploide
ca730cf714 added completions for micro 2020-09-18 19:41:44 +02:00
Fabian Homborg
c4b7abc6ef docs: Misc changes
Some formatting improvements, an explanation of $PWD, and some updates
- --on-process-exit is gone, the fish_command_not_found event is gone,
nobody has sent enhancements via the mailing list in years.

[ci skip]
2020-09-18 17:19:44 +02:00
Fabian Homborg
c53107a3ad docs: Destuffify
There really is no need to show our technical writing prowess here, we
can use plain english.

[ci skip]
2020-09-18 17:10:40 +02:00
Fabian Homborg
d95dc15dac docs: Some more on custom bindings
Show another fish_key_reader run, explain what keys we pressed,
explain the escape delay.
2020-09-18 17:09:44 +02:00
Fabian Homborg
7845539990 docs: Change "Builtin Commands" section
This harkens back to the days of fish's "we don't need no stinkin'
echo" minimalism. That's long past, we have a bunch useful builtins
now just because they are useful, not because they have to be builtins.

[ci skip]
2020-09-18 17:03:56 +02:00
Fabian Homborg
dca6eee55f docs: Less "the user", more "you"
The person reading this is "you". It's completely okay and sounds
better to address them directly.

When we're talking about OS users or users of fish script the reader
writes, "the user" is still okay.

[ci skip]
2020-09-18 16:53:59 +02:00
Fabian Homborg
c188ecf6c7 docs: Reword Tab Completion section
[ci skip]
2020-09-18 16:46:52 +02:00
Fabian Homborg
63adb6871b docs: "fish" is a normal word
We don't need to emphasize it with a monospace block.

Just on index.rst for now.

Work towards #6785.

[ci skip]
2020-09-18 16:40:09 +02:00
Fabian Homborg
c932c03069 docs: Explain more variables for fish_git_prompt
Also some wording enhancements
2020-09-18 16:32:28 +02:00
Johannes Altmanninger
291d1fbf1b Recompute completions if previous attempt failed
When pressing tab repeatedly, completions only computed on the first one. This
is because the old logic assumed that completions are present if the last
key was tab. Recompute them if there are no completions at all.

Fixes #6863
2020-09-17 18:44:54 +02:00
Johannes Altmanninger
6ec0b583f5 __fish_paginate: move the cursor to end of recalled commandline
When pressing \ep on an empty commandline, the cursor would stay at the
beginning of the commandline. Move it to the end of the previous command,
this feels a bit more natural.
2020-09-17 18:44:54 +02:00
Johannes Altmanninger
07c8608034 Fix make -j description 2020-09-17 18:44:54 +02:00
Fabian Homborg
181ce4a6b6 Actually create runtime path if needed
This checked if the path was readable and only then tried creating it,
which... isn't right.

Fixes #7335.
2020-09-17 12:33:56 +02:00
Fabian Homborg
58245b6fe7 set_color: Honor modifiers (bold, background..) with --print-colors
Fixes #7314
2020-09-17 12:33:56 +02:00
Mahmoud Al-Qudsi
304649acc6 [zfs] Add completions for new dataset prefix
[ci skip]
2020-09-16 14:37:59 -05:00
Fabian Homborg
e86a31f6d4 Use the newly fixed test -t in isatty
Removes a weird dependency on the test command.
2020-09-16 21:02:59 +02:00
Fabian Homborg
709e91c1e6 builtin test: Let -t work for the standard streams
Since builtins don't actually have the streams connected, but instead
read input via the io_streams_t objects, this would just always say
what *fish's* fds were.

Instead, pass along some of the stream data to check those
specifically - nobody cares that `test`s fd 0 *technically* is stdin.
What they want to know is that, if they used another program in that
place, it would connect to the TTY.

This is pretty hacky - I abused static variables for this, but
since it's two bools and an int it's probably okay.

See #1228.

Fixes #4766.
2020-09-16 21:02:59 +02:00
Fabian Homborg
1215717d20 Set exit status with delete-or-exit
(regression from d415350aaf)

This is important especially in e.g. the new Windows Terminal, because
for some reason that lets the tab stick around if the process exited
with a non-zero status.

Will add tests as soon as I figure out how.
2020-09-16 21:02:59 +02:00
David Adam
f9505996e7 README/CHANGELOG: make Python requirements consistent
[ci skip]
2020-09-16 15:57:36 +08:00
David Adam
465c2d06aa CHANGELOG: work on 3.2.0
[ci skip]
2020-09-16 15:57:27 +08:00
ridiculousfish
1fd9debaad jobs test to detect zombies before running
If there is any zombie process, the jobs.fish test will fail. Add an
explicit check to report when this happens.
2020-09-13 19:28:14 -07:00
ridiculousfish
2a8e104cc8 Relax some main thread requirements around waiting for jobs
This is now correctly per-parser so the thread should no longer matter.
2020-09-13 17:54:52 -07:00
ridiculousfish
1ba9c7ea56 Use temporary files for the background job pgroup test
This also reduces the likelihood of a race.
2020-09-13 15:36:26 -07:00
ridiculousfish
a698b1f96c Reenable pgroup eval test in more robust form
This re-enables the test that eval retains pgroups, from #6806.
The old version was racey and failed a lot. In the new version, we use
temp files to resolve the race.
2020-09-13 13:44:35 -07:00
ridiculousfish
9ba12aad55 Fix the tests
Make the features_t constructor public so the tests compile. Mea culpa.
2020-09-12 19:06:28 -07:00
ridiculousfish
6e11750479 Make the global feature set an instance variable
Allow it to be inlined.
2020-09-12 17:35:21 -07:00
Fabian Homborg
1c43030d79 cd: Remove unneeded code
This now works in cd proper, so it's unneeded in the function.
2020-09-12 20:17:30 +02:00
Fabian Homborg
5fd3ad624f screen: Show suggestion if the commandline was pushed to a new line
Pretty sure this was just overlooked, the comment mentions that it
should happen and it seems to work.

Fixes #7213.
2020-09-12 20:09:26 +02:00