Commit Graph

9006 Commits

Author SHA1 Message Date
ridiculousfish
5eada4b623 Put some of builtin_test in an anonymous namespace
Reduces the binary size a bit
2018-08-04 15:49:20 -07:00
ridiculousfish
d2bee105c9 Default math scale to 6
This changes the behavior of builtin math to floating point by default.
If the result of a computation is an integer, then it will be printed as an
integer; otherwise it will be printed as a floating point decimal with up to
'scale' digits past the decimal point (default is 6, matching printf).
Trailing zeros are trimmed. Values are rounded following printf semantics.

Fixes #4478
2018-08-04 15:32:09 -07:00
Maximilien Mellen
78cac07d3c Fix Informative VCS sample prompt invalid state
The Informative VCS sample prompt currently sets the `__fish_git_prompt_char_conflictedstate` variable which is unused.
It should instead set the `__fish_git_prompt_char_invalidstate` variable.
2018-08-04 13:35:03 -07:00
Clément Martinez
a536d2bc1f Add xclip completions 2018-08-04 12:00:18 -07:00
Birger J. Nordølum
c300e09e8c brew.fish: Fix brew casks search 2018-08-03 22:46:54 +08:00
David Adam
22ccee3380 wutil.h: fix build on newer glibc
https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
2018-08-03 22:35:50 +08:00
ridiculousfish
40e37c4a87 Teach test to handle floating point values 2018-08-03 00:48:50 -07:00
ridiculousfish
42c648ab35 Create an immortal C locale
This adds a function fish_c_locale() which returns an immortal locale_t
corresponding to the C locale, and switches builtin_printf to use wcstod_l.
2018-08-03 00:48:50 -07:00
Mahmoud Al-Qudsi
09541e9524 Add completions for hjson 2018-07-30 14:38:00 -05:00
Mahmoud Al-Qudsi
46b65a550f Reverse order of files and directories in __fish_complete_suffix output
Ordering of directories above files was introduced in a recent change to
the same script. By default it does not matter as completions are sorted
by fish internally, but this allows the use of `-k` to sort files before
directories (or piped to `sort -r` for vice-versa).
2018-07-30 14:31:47 -05:00
Mahmoud Al-Qudsi
392cdd4338 Show a meaningful description of packages in __fish_print_packages
Use `apt-cache show` instead of `apt-cache packagenames` to efficiently
print package names and a brief description instead of the placeholder
(localized) "Package" text that was previously printed. This applies to
both available and installed packages (for inistall and remove operations,
respectively).

TODO: update `__fish_print_packages` for non-debian platforms to do the
same.
2018-07-28 17:44:17 -05:00
Mahmoud Al-Qudsi
1ca58984bf [debian] Exclude packages with dpkg state 'deinstall' from installed list
When listing packages already installed (e.g. for use with `apt remove
...`), do not consider packages return by `dpkg --get-selections` with
state 'deinstall'.

Previously the `string replace` pattern was matching both 'install' and
'deinstall' packages.
2018-07-28 17:44:17 -05:00
Clément Martinez
32ca6118a6 Add virsh completions 2018-07-28 14:44:11 -07:00
raichoo
d4f5689eaa modernize darcs completion
`darcs` has changed a lot in recent years. The completion is no longer
up to date.
2018-07-28 13:10:13 -07:00
David Adam
3561f36cc4 CHANGELOG: initial updates for 3.0
[ci skip]
2018-07-27 16:50:32 +08:00
raichoo
eb3541be86 add more options to set completion 2018-07-24 20:29:36 +08:00
Twinkle
8440d9ba86 Improve completions for serve 2018-07-24 00:22:13 -07:00
raichoo
06cd4dc66f vi key bindings: fix "*y 2018-07-23 16:22:12 +02:00
raichoo
b932522138 add more options to psub completion 2018-07-22 15:23:16 -07:00
ridiculousfish
9d1fc1045e Implement 'functions -d' to set function description
This was documented, but didn't actually work.

Fixes #5105
2018-07-22 11:28:05 -07:00
ridiculousfish
7af3adc344 Revert "Don't require ./etc to exist in relocatable fish"
This reverts commit e2a3dae58b.

This idea failed because ./share was not complete when bliding via cmake;
it misses critical files such as config.fish.
2018-07-21 20:57:21 -07:00
ridiculousfish
8b83fe1ff7 Simplify yet more memory management in argparse 2018-07-21 19:13:10 -07:00
ridiculousfish
c269ef2c5d Copy strings less in argparse 2018-07-21 18:53:03 -07:00
ridiculousfish
3c4c47f516 Clean up some memory usage in argparse
Clarify some ownership models
2018-07-21 18:52:54 -07:00
ridiculousfish
a374b8ede7 Simplify splitting on commas in argparse 2018-07-21 17:25:16 -07:00
ridiculousfish
e2a3dae58b Don't require ./etc to exist in relocatable fish
fish tries to be relocatable by looking for directories relative to its
executable. These directories are not found when running fish from
within a cmake build because the etc directory is not present. Stop requiring
this directory to be present since it's not critical for running fish.

Fixes #4825
2018-07-21 16:47:00 -07:00
ridiculousfish
0f568d4f66
Merge pull request #5104 from ridiculousfish/expect_tests
Teach cmake to run expect tests
2018-07-21 16:03:58 -07:00
ridiculousfish
11502c0d36 Teach cmake to run expect tests
Fixes #4794
2018-07-21 15:43:31 -07:00
ridiculousfish
57cc3d950d Remove some unnecessary test output 2018-07-21 15:31:14 -07:00
ridiculousfish
dae2809531 Fix a few warnings 2018-07-21 14:35:39 -07:00
ridiculousfish
a11e955c84
Merge pull request #5097 from ridiculousfish/history_read
Don't mmap history files on remote file systems

This merges some changes to history that may help to mitigate the crashes seen in #5088 . These SIGBUS crashes occur when reading a memory mapping whose underlying file was truncated. It's not clear why this should occur more often on NFS (or ever). However memory mapping over NFS is sketchy anyways so this is desirable regardless.
2018-07-21 13:51:49 -07:00
ridiculousfish
c636a455a0 Add locking to try_complete_user
This uses the thread-unsafe getpwent(). Add a lock around the whole section
to avoid the crash identified in #5088
2018-07-15 15:50:56 -07:00
ridiculousfish
4d1eeef3db Stop trying to mmap the history file on remote fs
When the history file is on a remote filesystem, memory mapping is suspicious.
Never mmap in this case.
2018-07-15 15:26:36 -07:00
ridiculousfish
679437d6a9 Implement fd_check_is_remote
This adds a new function fd_check_is_remote() which is designed to determine
if a file lies on a remote (SMB, NFS, etc.) filesystem.
2018-07-15 15:26:36 -07:00
ridiculousfish
a39734cbed Encapsulate history mmap logic
Migrate the mmap() logic into a new class history_file_contents_t which
will serve to encapsulate conditional logic if we choose to use read()
instead of mmap().
2018-07-15 15:26:27 -07:00
ridiculousfish
63e0a3d7c2 Misc cleanup in history_t
Add some C++11
2018-07-15 14:33:38 -07:00
ridiculousfish
2ce0240fc8 Add a time_profiler for reading old history items 2018-07-15 14:33:38 -07:00
David Adam
c5ec7daab4 Revert "license.hdr: add Apache2 license for wcwidth9"
This reverts commit 00f2099f29. wcwidth9
has been removed.
2018-07-14 15:43:37 +08:00
James Lee
e26bdff487 Improve eopkg completions by using the --installed flag (#5089)
Utilized the `--install` flag added in commit #8c09d6e.

Limit `eopkg remove/autoremove/check ...` completions to installed packages.
Limit `eopkg install/upgrade/info ...` completions to available packages.
2018-07-09 23:21:44 -07:00
ridiculousfish
6a6ffe68cb Make __fish_describe_command stop barfing on /
Prior to this fix, __fish_describe_command would error if the
input contained any special characters, because it would be interpolated
into a regex. Hack in a guard to do nothing if the input contains
anything other than [a-zA-Z0-9_ ]
2018-07-09 23:13:53 -07:00
ridiculousfish
87f646d84d Correct spelling of 'consistently' 2018-07-09 20:55:55 -07:00
gkdoc
c04cb9c715 Update FORMATTING.md (#5087) 2018-07-09 20:54:56 -07:00
ridiculousfish
28455235b1 Migrate to widechar_wcwidth
Adopt the new widechar_wcwidth() function from
https://github.com/ridiculousfish/widecharwidth

Fixes #5081
2018-07-09 20:31:16 -07:00
David Adam
7de9563aad docker completions: add dummy file noting they are upstream
Suggested in #5090.
2018-07-08 21:38:08 +08:00
Guilhem Saurel
994f5c500b update nim.fish sample prompt (#5066)
* update nim.fish sample prompt

- Use an helper function to wrap informations
- Add VIRTUAL_ENV infos, if any
- Add __fish_git_prompt, wrapped for the theme
- Add comments
- Remove ASCII failback symbols for tty
  (no more useful for me, but if someone really needs it, just ask)

* fish.nim: test -n __fish_git_prompt
2018-07-05 22:30:52 +02:00
Simon Legner
dfbffd13df [completions/git] Fix typo 2018-07-05 22:28:52 +02:00
Mahmoud Al-Qudsi
eec4b399b5 Fix accidental recursive invocation of make under BSD
The backticks in the cmake not installed error message were not
escaped, leading to accidental recursive invocation of `make`.
2018-07-04 20:51:06 -05:00
Fabian Homborg
7ead8f459e [completions/git] Offer containing directories
Fixes #5083.
2018-07-04 15:11:32 +02:00
Sam Yu
495c09fe6b Add subcommand options completion for zypper 2018-07-03 13:45:39 -07:00
Mahmoud Al-Qudsi
8c09d6e063 Limit apt remove ... completions to installed packages only
Added a new flag `--installed` via `argparse` to `__fish_print_packages`
which indicates that only installed packages should be listed.

TODO: Other non-debian/apt platforms should take advantage of this flag/
behavior as well.
2018-07-02 11:43:18 -05:00