Commit Graph

10802 Commits

Author SHA1 Message Date
ridiculousfish
e1f46d22de Simplify space binding and fix search
With the new support for self-insert inserting a bound sequence,
the default binding for space as expanding abbreviations can be simplified
to just `self-insert expand-abbr`. This also fixes the bug where space
would cancel pager search.
2019-09-21 16:06:19 -07:00
ridiculousfish
18b56637f7 self-insert bindings to insert their own sequence
Prior to this fix, self-insert would always wait for a new character.
Track in char_event what sequence generated the readline event, and then
if the sequence is not empty, insert that sequence.

This will support implementing the space binding via pure readline
functions.
2019-09-21 15:58:57 -07:00
ridiculousfish
1ecbe363d0 Correct an assertion message 2019-09-21 15:17:09 -07:00
ridiculousfish
3f7bc7232e yank_POP -> yank_pop 2019-09-21 14:31:22 -07:00
ridiculousfish
5f64972908 Do not try the same (command, wraps) pair more than once when completing
This prevents runaway wrap chains. Fixes #5638.
2019-09-21 14:09:38 -07:00
ridiculousfish
77dbe109e0 Allow cancellation out of expanding a runaway wrap chain
This makes it easier to control-C out of a completion.
2019-09-21 13:11:45 -07:00
ridiculousfish
3f2f44ce73 Introduce reader_test_should_cancel
This centralizes the logic around cancellation due to either sigint or a
stale threaded operation.
2019-09-21 13:07:55 -07:00
ridiculousfish
95aea7839d Show wrap targets when printing a function
Fixes #1625
2019-09-21 12:48:51 -07:00
ridiculousfish
a1f1abc137 Stop passing true to escape_string
It wants a flags, not a boolean.
2019-09-21 12:40:24 -07:00
Johannes Altmanninger
a7ea7648c3 Completion: maintain cursor position when there is no completion
Previously, tab-completion would move the cursor to the end of the current token, even
if no completion is inserted. This commit defers moving the cursor until we insert a completion.

Fixes #4124
2019-09-21 12:50:52 -07:00
Johannes Altmanninger
e9e92178a9 completions: simplify prefix computation 2019-09-21 12:50:52 -07:00
Johannes Altmanninger
6c5c0a73eb remove useless call, fix comment 2019-09-21 12:50:52 -07:00
ridiculousfish
4b181df254 Correctly detect the presence of gdate
Fixes some test spew
2019-09-21 12:12:08 -07:00
ridiculousfish
d7c695114a Switch from subprocess.run to subprocess.check_call
Restores Python 2 compatibility in conf.py
2019-09-21 12:04:21 -07:00
ridiculousfish
56c0b99799 Format conf.py with black 2019-09-21 11:58:58 -07:00
David Adam
66fd52aa15 fish_xgettext: update translation generation for new build system
Closes #6123.
2019-09-21 22:29:19 +08:00
LawAbidingCactus
d4a5ef1703 rewrite __fish_complete_gpg2_key_id to produce better output 2019-09-21 22:04:17 +08:00
LawAbidingCactus
b8ba04dcf4 fix compatibility with BSD sed 2019-09-21 22:04:17 +08:00
LawAbidingCactus
2f67cb341c add remaining gpg2-specific completions; formatting 2019-09-21 22:04:17 +08:00
LawAbidingCactus
1a59731ea7 Create updated completions for gpg2 2019-09-21 22:04:17 +08:00
LawAbidingCactus
d2e9ee290c rewrite __fish_complete_gpg_key_id to produce better output 2019-09-21 21:58:59 +08:00
David Adam
8e0aa03c4a cmake: sphinx-manpages requires fish_indent for version number
Fixes issue #6216.

Problem introduced in 3b8505bebe.
2019-09-21 16:32:24 +08:00
Aaron Gyes
102ddd2b79 tests/checks/complete.fish: don't check unsorted lines 2019-09-19 15:44:15 -07:00
Aaron Gyes
6459682c93 Work around indeterminant ordering for complete test
Not a cool fix but it should work
2019-09-19 15:35:25 -07:00
Aaron Gyes
9486af8805 tests: fix date --version printing junk, update interactive.fish 2019-09-19 15:06:51 -07:00
Aaron Gyes
53a3533285 Add tests for complete (no args) output
Hopefully this should catch things if the output gets broken again.
2019-09-19 15:01:09 -07:00
Aaron Gyes
5c06e68115 tests: add a lame gdate-based ms-precision timer if installed
I got tired of seeing ' ... ok (0 sec)' so now with GNU date/gdate
installed there is millisecond output shown. One can get rough
nanoseconds from gdate.
2019-09-19 14:26:53 -07:00
Aaron Gyes
2b7b70a64f Ellipsis OCD 2019-09-19 11:48:37 -07:00
Aaron Gyes
fda8ad429b parse_util.cpp: remove truncate_string()
We already have something that does this
2019-09-19 10:32:07 -07:00
Aaron Gyes
cb79d8fa97 Colorize complete output
If interactive, `complete` commands are highlighted like they would
be if typed. Adds a little fun contrast and it's easier to read.

Moved a function out of fish_indent to highlight.h
2019-09-19 04:27:33 -07:00
Aaron Gyes
620761b9b9 complete: print long option names for less common ones
we now print --long options for ones I arbitrarily decided
are less likely to be remembered.

Also fixed the `--wraps` items at the end not being escaped
2019-09-19 04:21:24 -07:00
Aaron Gyes
e9ee2fb089 complete: support -k (--keep-files) in printed completions 2019-09-19 02:01:33 -07:00
Aaron Gyes
7302dcc12b complete: terser output with short options
Most of our completion scripts are written using the short options
anyhow, and this makes it less likely the output will span several
lines per command
2019-09-19 01:50:26 -07:00
David Adam
3b8505bebe sphinx: get version number from built binary 2019-09-19 15:05:39 +08:00
David Adam
3ae12ac4d3 Revert "Escape separators (colon and equals) to improve completion"
This reverts commit f7dac82ed6 from pull
request #6059.

As discussed in #6099, this caused a regression in some completions (eg
dd).
2019-09-19 14:38:16 +08:00
Aaron Gyes
b7dd060dec sample prompts: use $USER instead of (whoami) 2019-09-18 23:35:16 -07:00
Aaron Gyes
f35e18bb9b complete.cpp: don't double escape commands in complete output
The argument to --command was escaped both here and in
append_switch(), potentially producing incorrect output
2019-09-18 16:21:21 -07:00
Johannes Altmanninger
eea3bd5fc3 completions/git: improve completion for git restore and git switch
- suggest relevant files for git restore
- add `-r` to require an argument for some options
2019-09-18 14:08:43 -05:00
Johannes Altmanninger
ec834820f5 completions/git: handle 2 RM and 2 RD files
This commit makes git completions aware of files that are both staged as renamed, and have unstaged
modifications/are deleted.

__fish_git_files now potentially prints these files twice:

$ __fish_git_files renamed modified
foo   Renamed file
foo   Modified file

Fixes #6031
2019-09-18 14:03:11 -05:00
Johannes Altmanninger
8baea8b157 Do not add a space after completion if one is already there
Example: type `cd --help --help`, move the cursor inside the first `--help` and press tab.
This used to add redundant spaces.
2019-09-18 14:02:24 -05:00
Aaron Gyes
22811ebcf6 Remove unused macros
Most just left behind after actual code was moved into different files.
2019-09-18 01:31:03 -07:00
Aaron Gyes
715836cb0a builtin_set_color.cpp: remove unnecessary .c_str() 2019-09-18 00:09:23 -07:00
Aaron Gyes
5f05d9734c builtin_set_color.cpp: colorize set_color --print-colors
Each named color is now printed in that color, only if
hooked up to a TTY. Shouldn't affect scripts.
2019-09-18 00:05:09 -07:00
Aaron Gyes
61f0756fe6 builtins: Use standard builtin.h error macros more 2019-09-17 22:04:33 -07:00
David Adam
a10547018e cmake: don't install realpath manpage on non-macOS systems 2019-09-17 20:54:11 +08:00
David Adam
e6d6c5c5c7 docs: improve realpath documentation 2019-09-17 20:48:22 +08:00
David Adam
02d82dcf85 docs: update all command synopsis formatting
Adds synopses for those commands missing them.

Moves all synopsis sections to code blocks. This improves the appearance, although highlighting as
fish code may not be the ideal appearance.
2019-09-17 17:59:04 +08:00
David Adam
c93c66f76b docs: fix formatting in prompt_pwd manual 2019-09-17 17:31:47 +08:00
David Adam
605885f851 docs: whitespace cleanup in source
Fixes some lint warnings.
2019-09-17 17:28:19 +08:00
David Adam
f11ee26aae docs: slight grammar improvement in source docs
[ci skip]
2019-09-17 16:37:35 +08:00