aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* implement swap-selection-start-stop functionGravatar Federico Ferri2016-03-20
| | | | | | | | | The swap-selection-start-stop function goes to the other end of the highlighted text, the equivalent of `o' for vim visual mode. Add binding to the swap-selection-start-stop function, `o' when in visual mode. Document swap-selection-start-stop, begin-selection, end-selection, kill-selection.
* fix handling of non-ASCII chars in C localeGravatar Kurtis Rader2016-03-20
| | | | | | | | | | | | The relevant standards allow the mbtowc/mbrtowc functions to reject non-ASCII characters (i.e., chars with the high bit set) when the locale is C or POSIX. The BSD libraries (e.g., on OS X) don't do this but the GNU libraries (e.g., on Linux) do. Like most programs we need the C/POSIX locales to allow arbitrary bytes. So explicitly check if we're in a single-byte locale (which would also include ISO-8859 variants) and simply pass-thru the chars without encoding or decoding. Fixes #2802.
* env_universal_common: use uid_t in geteuid checksGravatar David Adam2016-03-18
| | | | | | | | | The u_int typedef fails to compile on all platforms (e.g. Windows). It is part of the code imported from tmux. Update it to the SUS-standard uid_t. Closes #2821.
* parse_execution.cpp: Remove line continuationsGravatar Andreas Nordal2016-03-17
| | | | My IDE (Kdevelop 4.7.3) didn't tackle them.
* Improve error handling around fchownGravatar Jeff Kowalski2016-03-12
| | | | | | | | | Address the feedback from the prior commit: - Change the sense of return value testing to match more common comparison idiom - Test result of fchmod as well as fchown - Change sense of return value testing around wrename as well - Include errno where possible in error message
* Handle return values from fchownGravatar Jeff Kowalski2016-03-12
| | | | | | | | | | | The function fchown is annotated with warn_unused_result. As formerly used in the code, it would emit a compiler warning ```warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result [-Wunused-result]``` This commit notes the return value and emits appropriate error/logging messages if the call fails, creating more traceable results and satisfying the compiler.
* assume getopt/getopt_long is availableGravatar Kurtis Rader2016-03-08
| | | | | | | | | | | There is no longer a good reason to detect whether or not getopt_long() is available. All UNIX implementations we're likely to run on have it. And if we ever find one that doesn't the right thing to do is not fallback to getopt() but to include the getopt_long() source in our package like we do with the pcre2 library. Since it's licensed under LGPL we can legally do so if it becomes necessary. This partially addresses issue #2790.
* expand_string should not return any results on errorGravatar ridiculousfish2016-03-05
| | | | Fixes #2796
* Save a few string allocations when importing environment variablesGravatar ridiculousfish2016-03-05
|
* Prefer the first, not last, of any env var duplicatesGravatar ridiculousfish2016-03-05
| | | | | If envp contains duplicate environment variables, use the first value, not the last value. Fixes #2784.
* A few fixes suggested by Coverity ScanGravatar ridiculousfish2016-03-03
|
* Tweak UTF8 decoding interfaceGravatar ridiculousfish2016-03-02
| | | | | | | | Previously, when decoding UTF-8, we would first run through the array to compute the correct size, then allocate a buffer of that size, then run through the array again to fill the buffer, and then copy it into a std::wstring. With this fix we can copy it into the string directly, reducing allocations and only requiring a single pass.
* reduce number of Unicode private-use charactersGravatar Kurtis Rader2016-02-28
| | | | | | | | | This narrows the range of Unicode codepoints fish reserves for its own use from U+E000 thru U+F8FE (6399 codepoints) to U+F600 thru U+F73F (320 codepoints). This is still not ideal since fish shouldn't be using any Unicode private-use codepoints but it's a step in the right direction. This partially addresses issue #2684.
* Eliminate narrow_string_rep_tGravatar ridiculousfish2016-02-28
| | | | | | | | | | This was used to cache a narrow string representation of commands, so that if certain system calls returned errors after fork, we could output error messages without allocating memory. But in practice these errors are very uncommon, as are commands that have wide characters. It is simpler to do a best-effort output of the wide string, instead of caching a narrow string unconditionally.
* Re-use the parse tree generated during error detection for executionGravatar ridiculousfish2016-02-28
| | | | | | | Prior to this fix, read_ni would use parse_util_detect_errors to lint the script to run, and then parser_t::eval() to execute it. Both functions would parse the script into a parse tree. This allows us to re-use the parse tree, improving perfomance.
* Allow parse_execution_context to take ownership of a parse treeGravatar ridiculousfish2016-02-28
| | | | | | Introduces a new template moved_ref which is like an rvalue reference. This allows passing around objects while being explicit that the receiver may acquire ownership. This will help reduce some allocations.
* Add missing #include guards in FISH_PAGER_HGravatar ridiculousfish2016-02-27
|
* Remove unused MESS_SIZE defineGravatar ridiculousfish2016-02-27
|
* Remove some unnecessary statics and a silly #define constGravatar ridiculousfish2016-02-27
|
* Mark a bunch of constructors as explicitGravatar ridiculousfish2016-02-27
| | | | This prevents undesired implicit conversions
* Make expand_argument_list a static functionGravatar ridiculousfish2016-02-27
| | | | It doesn't use any properties of parser_t
* Eliminate parser_t::show_errorsGravatar ridiculousfish2016-02-27
| | | | Errors are now unconditionally shown
* Eliminate parser_type_tGravatar ridiculousfish2016-02-27
| | | | It was never fully implemented and wasn't used for anything
* Allow -w option as short for --wraps in define_functionGravatar ridiculousfish2016-02-27
| | | | Fixes #2772
* Allow variable completion from just a $Gravatar ridiculousfish2016-02-27
| | | | | Previously there had to be some variable text, now you can tab complete from just a naked $.
* Save a few allocations in src/parse_execution.cppGravatar ridiculousfish2016-02-27
|
* Fix a subtle problem that caused lots of unnecessary memory allocationGravatar ridiculousfish2016-02-27
|
* Send BEL to terminal to flash/beep while trying to complete something not ↵Gravatar Aaron Gyes2016-02-25
| | | | completeable.
* Resume sorting completions from wildcard expansionsGravatar ridiculousfish2016-02-22
| | | | Ought to fix the wildcard expansion test on Linux
* Remove an unused variableGravatar ridiculousfish2016-02-22
|
* make fish compatible with pcre2 10.21Gravatar Michael Steed2016-02-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
* Miscellaneous cleanup and dead code removalGravatar ridiculousfish2016-02-19
| | | | Noticed by cppcheck
* Remove some newly dead codeGravatar ridiculousfish2016-02-18
| | | | out_suggested_cdpath is no longer required from is_potential_path
* Remove autosuggest_suggest_specialGravatar ridiculousfish2016-02-18
|
* Implement the cd "unique hierarchy" autosuggestion in expand.cppGravatar ridiculousfish2016-02-18
|
* Teach tests about changes to special autosuggestionsGravatar ridiculousfish2016-02-18
|
* Always env_set_pwd after chdir in the fish testsGravatar ridiculousfish2016-02-18
| | | | This avoids confusion between getcwd() and $PWD
* Additional work on unifying cd autosuggestions with completeGravatar ridiculousfish2016-02-18
|
* Complete to take a pointer to output completions, not a mutable refGravatar ridiculousfish2016-02-18
|
* Migrate sort_and_prioritize to complete.cppGravatar ridiculousfish2016-02-18
|
* Switch autosuggest_suggest_special to returning a completion_tGravatar ridiculousfish2016-02-18
|
* Early work towards moving the cd special autosuggestion into completionsGravatar ridiculousfish2016-02-18
| | | | This will simplify some code and make the cd autosuggestion smarter
* Stop always returning STATUS_BUILTIN_ERROR on --merge.Gravatar Aaron Gyes2016-02-16
|
* Remove a debug() guarded by a surprising get_is_interactiveGravatar ridiculousfish2016-02-16
| | | | | | get_is_interactive can crash if proc_init has not been called. Fixes #2280
* Use contains instead of string ==Gravatar ridiculousfish2016-02-15
| | | | Fix a few typos too
* Reinstate failglob behaviour for most commandsGravatar Andreas Nordal2016-02-15
| | | | | | | | | | | | | | | | | 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 cab115c8b9933ae7db9412c66d452c0ccb2d7152), but this was undocumented; the failglob warning was still printed in interactive mode, and the documentation was bragging about failglob behaviour.
* Remove an unnecessary typecastGravatar ridiculousfish2016-02-10
|
* Remove a stale comment about constGravatar ridiculousfish2016-02-10
|
* Remove const from _wgetopt_internal's argv argumentGravatar Jon Eyolfson2016-02-10
| | | | The argv argument may be modified on calls to exchange within the function and should not be const qualified (it's not true from the caller's point of view).
* fish_tests: Explicitly cast -2 to wchar_tGravatar Andy Lutomirski2016-02-08
| | | | | | On arm, wchar_t is unsigned, and C++11 and newer disallow implicit narrowing conversions inside braces. Use an explicit conversion to fix the build on GCC 6 and up, which defaults to C++11.