Commit Graph

13067 Commits

Author SHA1 Message Date
Fabian Homborg
06f6436943 reader: Return true if suppress-autosuggestion suppressed
This allows

bind -k backspace suppress-autosuggestion or backward-delete-char

To remove the suggestion on the first press and then delete
chars.

Note: This requires that we then don't reenable suggestions
immediately afterwards. Currently we don't after deletion.

Fixes #1419.
2020-09-26 10:09:55 +02:00
Fabian Homborg
537b3f6cb1 tests/exec: Wait after writing to a file before executing it
Otherwise we might get "text file is busy", or worse no error at all.

Hoping .2 seconds is enough here.
2020-09-26 07:22:17 +02:00
Johannes Altmanninger
e9582c41b2 Remove __fish_complete_external_command
It's no longer used.
2020-09-25 19:33:01 +02:00
Johannes Altmanninger
618705285d completions/git: support ... range notation
https://git-scm.com/docs/gitrevisions#_revision_range_summary
2020-09-25 19:33:01 +02:00
Johannes Altmanninger
2a95b283ee completions/git: complete only right commit if cursor is beyond the ".."
This enables completion for the right part of a range in many cases, like
`git log HEAD~10..`.
2020-09-25 19:33:01 +02:00
Johannes Altmanninger
16ae532368 Fix typos in docs 2020-09-25 19:33:01 +02:00
Fabian Homborg
0d0ee473fa Detect windows line endings when executing a file
Fixes #2783.
2020-09-25 16:51:05 +02:00
Fabian Homborg
d636918795 Fix warnings in CHANGELOG
../CHANGELOG.rst:30: WARNING: Bullet list ends without a blank line; unexpected unindent.
../CHANGELOG.rst:117: WARNING: Inline literal start-string without end-string.

[ci skip]
2020-09-24 21:03:47 +02:00
Fabian Homborg
293a3a628d Remove pipestatus_with_signal
This was a wrapper around status_to_signal, just because that only
handled a single argument.

Instead, just teach status_to_signal to handle multiple arguments and
be done.
2020-09-24 20:14:10 +02:00
Fabian Homborg
dde8318e50 print_pipestatus: Simplify
Just some minor stylistic nits
2020-09-24 20:08:16 +02:00
Fabian Homborg
a776b08e84 Use bools, we have the technology 2020-09-24 18:53:19 +02:00
David Adam
4cb9f3224c CHANGELOG: work on 3.2.0
[ci skip]
2020-09-24 22:50:57 +08:00
Fabian Homborg
7cac8886bf docs: Some more on argument handling
Reword and expand the list section, and add another explicitly on
argument handling.

Fixes #4630

[ci skip]
2020-09-23 18:48:05 +02:00
Fabian Homborg
c1912e5624 docs: Change hybrid_binding function name
Just "hybrid_bindings" won't trigger the mode prompt.

(yes, this is cheesy)

[ci skip]
2020-09-23 18:15:53 +02:00
Fabian Homborg
1188a12dfd type: Print *only* the path if given --path or --force-path
This is what happens when you check your tests in the wrong tab,
folks.

Fixes #7345.
2020-09-23 17:24:51 +02:00
Mahmoud Al-Qudsi
533957fc2e [apt] Add --with-new-pkgs completion
[ci skip]
2020-09-22 21:52:47 -05:00
Fabian Homborg
8008dfda1e Reorder FAQ
Try to keep related things together - first the variable questions,
then the prompt questions, then more customization, then syntax
incompatibilities, ...

I'm not convinced all of these are actually frequently asked, or that
all frequently asked questions are here, but that's for later.

[ci skip]
2020-09-22 17:34:42 +02:00
Fabian Homborg
1da56f9937 Make history search smartcase
This makes history searches case-insensitive, unless the search string
contains an uppercase character.

This is what vim calls "smartcase".

Fixes #7273.
2020-09-22 16:13:24 +02:00
Johannes Altmanninger
0a0149cc2a Prevent infinite recursion when completion wraps variable assignment
Closes #7344

Apply a targeted fix to the place where complete() is called to handle nested
variable assignments.  Sadly, reporting an error is probably not okay here,
because people might legitimately use aliases like:

	alias vim "A=B command vim"

This is all a bit ugly, and I hope to find a cleaner solution.  Supporting
completions on commandlines like `x=$PWD cd $x/ ` is a nice feature but it
comes with some complexity.
2020-09-22 01:11:18 +02:00
Johannes Altmanninger
ca538fa8d8 Refactor: make function static and reformat
"IndentCaseLabels: false" seems nice but not now.
2020-09-22 00:17:19 +02:00
Mahmoud Al-Qudsi
383f1d1a19 fixup! Make type a builtin
[ci skip]
2020-09-21 15:42:55 -05:00
Fabian Homborg
c7b51b360d CHANGELOG
[ci skip]
2020-09-21 21:01:44 +02:00
Fabian Homborg
796d92b4e9 benchmark driver: Allow passing a second fish path to compare
[ci skip]
2020-09-21 20:58:39 +02:00
Fabian Homborg
ef9c924960 Make type a builtin
This is too important to not be one.

For one if it couldn't be loaded for any reason it would
break a lot of fish scripts.

Also this is faster by ~20x.

Fixes #7342
2020-09-21 20:58:34 +02:00
Fabian Homborg
7934972751 Add some more type tests 2020-09-21 17:45:15 +02:00
Fabian Homborg
3a05326a39 Move functions_def to function.cpp
We're gonna be using it in two places
2020-09-21 17:44:58 +02:00
Fabian Homborg
a5c1d72bd0 docs: Use "fish" without markup in tutorial
Work towards #6785.

[ci skip]
2020-09-20 20:17:08 +02:00
Fabian Homborg
66475732af Fix str2wcs for LANG=C
4f0ade7a73 broke the tests when LANG was
C, so the MB_CUR_MAX==1 path wasn't working.

Seemingly that cast is doing some work here?

Just revert that bit for now, since this path is unimportant
anyway (please, please, please, please use a unicode capable locale).
2020-09-20 15:05:49 +02:00
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