Commit Graph

5300 Commits

Author SHA1 Message Date
ridiculousfish
e8aab9183e Remove some unnecessary statics and a silly #define const 2016-02-27 19:45:43 -08:00
ridiculousfish
10f3ea0008 Mark a bunch of constructors as explicit
This prevents undesired implicit conversions
2016-02-27 19:38:15 -08:00
ridiculousfish
88a785e321 Make expand_argument_list a static function
It doesn't use any properties of parser_t
2016-02-27 18:40:54 -08:00
ridiculousfish
d628fe0dea Eliminate parser_t::show_errors
Errors are now unconditionally shown
2016-02-27 18:37:59 -08:00
ridiculousfish
cbd3fa6b01 Eliminate parser_type_t
It was never fully implemented and wasn't used for anything
2016-02-27 18:25:58 -08:00
ridiculousfish
584cca59bf Allow -w option as short for --wraps in define_function
Fixes #2772
2016-02-27 17:47:23 -08:00
ridiculousfish
6cb48c6380 Allow variable completion from just a $
Previously there had to be some variable text, now you can
tab complete from just a naked $.
2016-02-27 16:51:44 -08:00
ridiculousfish
99be3ee96f Save a few allocations in src/parse_execution.cpp 2016-02-27 16:51:32 -08:00
ridiculousfish
c1c35e0f21 Fix a subtle problem that caused lots of unnecessary memory allocation 2016-02-27 16:51:28 -08:00
Kevin Ballard
d8a497434f Rewrite __fish_urlencode to not encode valid characters
Much better to only encode the characters that are not URL-safe. This
also doesn't involve any forking, and it even handles newlines and NULs
in the input.
2016-02-27 00:14:52 -08:00
Kevin Ballard
211829c586 Remove share/config.fish from .gitignore
This is a file under version control, there's no reason it should be
listed here. Having it in .gitignore was causing tools like `ag` to
avoid looking at share/config.fish.
2016-02-26 21:14:16 -08:00
Kevin Ballard
2bb7c587f4 Skip over /etc/paths.d entries that don't exist
I had an old /etc/paths.d/TeX file that listed a path /usr/texbin that
doesn't exist anymore. This was causing the `set PATH` to print a
warning.
2016-02-26 20:26:24 -08:00
Kevin Ballard
2187c0a84b Standardize indentation in config.fish 2016-02-26 20:22:59 -08:00
David Adam
c359d28b21 README updates
[ci skip]
2016-02-26 21:46:48 +08:00
Fabian Homborg
c1b384e5d3 Add functions and configuration snippets hierarchy
This allows "vendors" (i.e. third-party upstreams interested in
supporting fish) to add auto-loaded functions and eager-loaded
configuration "snippets", while still allowing both the user and the administrator to
fully override all of that.

This has been inspired by systemd's configuration hierarchy, and implements a similar scheme
whereby files with the same name in higher-ranking directories override files in lower-ranking ones.

Fixes #1956
2016-02-26 12:14:55 +01:00
Kurtis Rader
8b67a1b26f make testing on local servers hermetic
I noticed while fixing issue #2702 that the fish program being tested
was sourcing config.fish files outside of the current build. This also
happens when Travis CI runs the tests but isn't an issue there because
of how Travis is configured to execute the tests.

I also noticed that running `make test` was polluting my personal fish
history; which will become a bigger problem if and when the fishd universal
var file is moved from $XDG_CONFIG_HOME to $XDG_DATA_HOME.

This change makes it possible for an individual to run the tests on
their local machine secure in the knowledge that only the config.fish and
related files from their git repository will be used and doing so won't
pollute their personal fish history.

Resolves #469
2016-02-25 17:16:36 -08:00
Aaron Gyes
c79ade9627 Send BEL to terminal to flash/beep while trying to complete something not completeable. 2016-02-25 08:18:27 +08:00
David Adam
d61e95e4f9 Makefile: enable maintainer mode for PCRE2
Closes #2469.
2016-02-24 18:14:41 +08:00
David Adam
68807f274e github: add issues template
[ci skip]
2016-02-24 16:06:26 +08:00
Fabian Weisshaar
a805d401b8 add completions for diskutil (osx) 2016-02-23 13:54:46 +01:00
Adam Dymitruk
2f52f073da Update index.hdr.in
simple grammar correction
2016-02-22 13:36:35 -08:00
Steve Stagg
c4cc9f9b8d add files for the fish logo as used for the fish-shell stickers 2016-02-22 12:27:39 -08:00
ridiculousfish
6c401bc587 Resume sorting completions from wildcard expansions
Ought to fix the wildcard expansion test on Linux
2016-02-22 03:37:39 -08:00
ridiculousfish
35160db268 Remove an unused variable 2016-02-22 03:37:03 -08:00
Michael Steed
5b0996fd80 make fish compatible with pcre2 10.21
pcre2_substitute() now sets the output buffer length to PCRE2_UNSET (~0)
if the output buffer is determined to be too small. This change keeps
track of the buffer size separately where pcre2 can't touch it.

A better fix would be to let pcre2 tell fish what size buffer it needs.
This can be done with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, but this
requires pcre2 10.21 or later (released January 12), which may be too
new to introduce as a dependency at this point.

Fixes #2743
2016-02-21 19:32:08 -08:00
Fabian Homborg
585c03db72 docs: Remove duplicate color variable listing 2016-02-21 13:58:15 +01:00
Aaron Gyes
613739ba07 Try to just see if grep is happy with --color=auto, or not, as the --help exit status varies in BSD vs. GNU. 2016-02-20 21:11:40 +01:00
ridiculousfish
947f659f96 Miscellaneous cleanup and dead code removal
Noticed by cppcheck
2016-02-19 15:45:31 -08:00
Fabian Homborg
8703c5bc00 Add fish_color_autosuggestion to docs
Fixes #2741.
2016-02-19 15:20:34 +01:00
ridiculousfish
43e1c0a2bf Remove some newly dead code
out_suggested_cdpath is no longer required from is_potential_path
2016-02-18 17:00:26 -08:00
ridiculousfish
99e18d9cef Remove autosuggest_suggest_special 2016-02-18 17:00:26 -08:00
ridiculousfish
718d9baead Implement the cd "unique hierarchy" autosuggestion in expand.cpp 2016-02-18 17:00:26 -08:00
ridiculousfish
e2f4584220 Teach tests about changes to special autosuggestions 2016-02-18 17:00:26 -08:00
ridiculousfish
4138073a2f Always env_set_pwd after chdir in the fish tests
This avoids confusion between getcwd() and $PWD
2016-02-18 17:00:26 -08:00
ridiculousfish
1907323afc Additional work on unifying cd autosuggestions with complete 2016-02-18 17:00:26 -08:00
ridiculousfish
c39b94949b Complete to take a pointer to output completions, not a mutable ref 2016-02-18 17:00:26 -08:00
ridiculousfish
31bc88d16f Migrate sort_and_prioritize to complete.cpp 2016-02-18 17:00:26 -08:00
ridiculousfish
5dbf40ca75 Switch autosuggest_suggest_special to returning a completion_t 2016-02-18 17:00:26 -08:00
ridiculousfish
2d68b25025 Early work towards moving the cd special autosuggestion into completions
This will simplify some code and make the cd autosuggestion smarter
2016-02-18 17:00:25 -08:00
Jak Wings
1767681f9a Fix the file URL for Terminal.app
* When using a UTF-8 locale, set locale to C temporarily in order to
  read one byte at a time.
* Use the builtin printf in a forward-compatible way. (GNU)
* Improve the readability of the code.
2016-02-16 21:49:58 -08:00
Aaron Gyes
0395c33982 Stop always returning STATUS_BUILTIN_ERROR on --merge. 2016-02-16 12:06:50 -08:00
Kurtis Rader
83d3c9fc04 fix flakey test
I've run this more than twenty times through Travis CI (by adding/removing
a comment line). Without this tweak the longest sequence seems to be
around six successful runs.
2016-02-16 11:40:40 -08:00
ridiculousfish
c184c1a81a Correctly handle --merge in the history.fish function
Previously --merge happened to work, but only because it was
smuggled in through the 'print' command
2016-02-16 11:34:36 -08:00
Aaron Gyes
31a617408f Fix typo 2016-02-16 05:14:33 -08:00
Aaron Gyes
a6565bbea8 Fix --merge hitting a case 2016-02-16 05:09:54 -08:00
ridiculousfish
81cdceddd3 Remove a debug() guarded by a surprising get_is_interactive
get_is_interactive can crash if proc_init has not been called.

Fixes #2280
2016-02-16 01:51:27 -08:00
ridiculousfish
5b506499c1 Use contains instead of string ==
Fix a few typos too
2016-02-15 13:27:00 -08:00
Andreas Nordal
62b76b26b4 Reinstate failglob behaviour for most commands
Expand globs to zero arguments (nullglob) only for set, for and count.

The warning about failing globs, and setting the accompanying $status,
now happens regardless of mode, interactive or not.

It is assumed that the above commands are the common cases where
nullglob behaviour is desirable.
More importantly, doing this with `set` is a real feature enabler,
since the resulting empty array can be passed on to any command.

The previous behaviour was actually all nullglob (since commit
cab115c8b9), but this was undocumented;
the failglob warning was still printed in interactive mode,
and the documentation was bragging about failglob behaviour.
2016-02-15 13:13:28 -08:00
Sunguk Lee
b72837a0f4 Improve __fish_print_users
Patch from `__make_users_completions` of killall command completion
2016-02-15 19:31:20 +09:00
Sunguk Lee
c4f702b7c4 Fix No command 'dscl' found error of killall command
`dscl` command have OSX system, to change `__fish_print_users`
2016-02-15 19:30:58 +09:00