Commit Graph

11302 Commits

Author SHA1 Message Date
Rosen Penev
5d1ad8de91
[clang-tidy] Use std::move
Found with modernize-pass-by-value
2019-12-26 21:36:23 -08:00
Rosen Penev
49fbca8a8b
[clang-tidy] Remove redundant const in function declarations
Found with readability-avoid-const-params-in-decls
2019-12-26 21:25:12 -08:00
Rosen Penev
856fa0ca42
[clang-tidy] Use override instead of virtual
Found with modernize-use-override
2019-12-26 21:25:12 -08:00
Rosen Penev
f2e7def667
[clang-tidy] Remove const from strings
Found with readability-const-return-type
2019-12-26 21:25:12 -08:00
Rosen Penev
668f73c0d6
[clang-tidy] Fix wrong declaration
Found with readability-inconsistent-declaration-parameter-name
2019-12-26 21:25:12 -08:00
Rosen Penev
9e42b0100a
[clang-tidy] Remove redudant .get on smart pointer
Found with readability-redundant-smartptr-get
2019-12-26 21:25:11 -08:00
Rosen Penev
2ecc386121
[clang-tidy] Remove redundant c_str
Found with readability-redundant-string-cstr
2019-12-26 21:25:07 -08:00
Rosen Penev
d1e82b59bb
[clang-tidy] Switch from size to empty check
Found with readability-container-size-empty
2019-12-26 20:07:53 -08:00
ridiculousfish
df0681d393 Remove process_generation_count_t
It was unused.
2019-12-26 13:33:14 -08:00
ridiculousfish
126e6a929f Remove the ARRAY_SEP define
It's unused.
2019-12-26 13:17:34 -08:00
Fabian Homborg
0e0d63c0df completions/pipenv: Really force it to print fish completions
"To assume" and such.

It doesn't check $SHELL, so it might have some other automagic that
can fail (probably still because of the login shell, but I have no
idea).

Override the special variable that
click-completion (https://github.com/click-contrib/click-completion)
uses to force it instead.

Really fixes #6454.

[ci skip]
2019-12-25 16:29:10 +01:00
Fabian Homborg
aba5beaeb4 completions/pipenv: Force it to print fish completions
This checks $SHELL to determine which completions to print, and $SHELL
is typically set by your login program.

So if the login shell isn't fish, this will print the wrong
completions.

Fixes #6454

[ci skip]
2019-12-25 16:16:08 +01:00
Fabian Homborg
bd8fd9fd0d docs/bind: Document and
[ci skip]
2019-12-25 10:46:46 +01:00
Fabian Homborg
e986970f4d Remove vi_arg_digit and vi_delete_to
They don't do anything anymore.
2019-12-25 10:44:27 +01:00
Fabian Homborg
c0f2e842ad Document missing bind functions
Turns out we never documented the "jump" ones.

That means the still-undocumented bind functions are

- vi-arg-digit
- vi-delete-to
- and

Mostly because I'd have to look up what they actually *do*, and
possibly rename them to be generic.

[ci skip]
2019-12-25 10:26:03 +01:00
Johannes Altmanninger
9f48fc6285 Fix status when function/block evaluation is cancelled
It looks like the last status already contains the signal that cancelled
execution.

Also make `fish -c something` always return the last exit status of
"something", instead of hardcoded 127 if exited or signalled.

Fixes #6444
2019-12-23 17:38:19 +01:00
David Adam
8ca936aea6 cmake: use C++ extension options when checking features
This matches the CMake default of extensions turned on.
2019-12-23 22:26:57 +08:00
David Adam
4d325dcd7a cmake: tidy up adding C++11 compile flags
Two blocks of code were trying to do the same thing in different ways;
standardise on one, and only add the compile flags if CMake won't do it
itself (policy CMP0067).
2019-12-23 22:26:57 +08:00
David Adam
74ab9e72ac cmake: pass C++ standard compiler options to tests
Enables CMake policy 0067.
2019-12-23 22:26:57 +08:00
Mathieu Duponchelle
15c1b3ed4b Place fish in its own process group when launched with -i
Fixes #5909
2019-12-23 10:32:37 +01:00
ridiculousfish
c19407ab0f Default parser_t::eval()'s block type to top
This is the parameter value at every call site except one. Just make it the
default.
2019-12-22 16:27:03 -08:00
ridiculousfish
0c49dce75d Factor block description part of stack traces into a new function 2019-12-22 16:22:20 -08:00
ridiculousfish
a59f35a378 Make block_type_t an enum class 2019-12-22 15:37:14 -08:00
ridiculousfish
4529e7d183 Reverse the order of the block stack
Previously, the block stack was a true stack. However in most cases, you
want to traverse the stack from the topmost frame down. This is awkward
to do with range-based for loops.

Switch it to pushing new blocks to the front of the block list.
This simplifies some traversals.
2019-12-22 15:07:41 -08:00
ridiculousfish
82baf74785 Attempt to fix the build
Move the CMake changes down in the file after the FIND_PACKAGE calls.
2019-12-22 12:31:14 -08:00
ridiculousfish
87854c81f5 Allow C++ standard to be passed to CHECK_CXX_SOURCE_COMPILES
Work around the issue in CMake where C++ standard doesn't get propagated
to CHECK_CXX_SOURCE_COMPILES. Also correctly check for std::make_unique;
the define was missing from the config.h header.
2019-12-22 12:07:46 -08:00
ridiculousfish
10ac83ae32 lru to use std::map, not std::unordered_map
We depend on pointer stability here and it just seems easier
to think about it with std::map.
2019-12-21 17:09:21 -08:00
Sergei Morozov
624e76ae89 Added the --cleanup option completion for the git commit command 2019-12-21 20:03:54 +01:00
David Adam
45633f4a54 cmake: force C++11 in CHECK_CXX_SOURCE_COMPILES for atomic
GCC 4.8 requires the use of `-std=gnu++11` or similar to enable atomic
features. However, older versions of CMake don't pick up the
project-wide target for C++11 when building the configure check targets.
Although CMake policy 0067 could be set to NEW to enable this, it only
exists on CMake 3.8 and newer, while many of our supported platforms are
on an older version.
2019-12-21 22:00:22 +08:00
Johannes Altmanninger
6dd9e50f82 time: complete external time options only if available 2019-12-21 11:56:06 +01:00
Fabian Homborg
f0df211f4c Solve remaining conflicts sv.po
Sorry!
2019-12-21 11:12:17 +01:00
Jason
126e37ab26 Remove all fuzzy translations (see also #6418) 2019-12-21 10:21:45 +01:00
Jason
28d812f543 Restore last good version of Swedish translations (08ff39c) 2019-12-21 10:21:39 +01:00
Jason
616ff28dea Remove all fuzzy translations 2019-12-21 10:17:12 +01:00
Dan Martinez
de37e52dca Mention how functions --details handles aliases (#6423)
* Mention how `functions --details` handles aliases

* Clarify that `source` is responsible for `-` paths
2019-12-21 09:59:14 +01:00
ridiculousfish
2e7cbaeaba Remove io_file_t::is_dev_null
This is no longer used.
2019-12-20 14:47:54 -08:00
ridiculousfish
97dd5ece26 Remove redirection_is_to_real_file
This was previously required so that, if there was a redirection to a
file, we would fork a process to create the file even if there was no
output. For example `echo -n >/tmp/file.txt` would have to create
file.txt even though it would be empty.

However now we open the file before fork, so we no longer need special
logic around this.
2019-12-20 14:40:57 -08:00
Fabian Homborg
17b499d2ea docs/printf: Don't double "%"
This might be a leftover from doxygen, but sphinx does *not* require
"%%" here to print "%", so it shows

    %%d

instead of the correct

    %d

[ci skip]
2019-12-20 17:13:21 +01:00
Fabian Homborg
dcf8b0e3aa Add test for time 2019-12-20 17:13:21 +01:00
David Adam
8f2f3b648f cmake: check for 64-bit atomic operations directly
780bac671f did not actually successfully
compile on any platforms, leading to -latomic always being added
(including on platforms it does not exist on).

Work on #5865.
2019-12-20 23:47:46 +08:00
David Adam
780bac671f cmake: add -latomic on platforms that need it for 64-bit atomic operations
Closes #5865.
2019-12-20 23:00:06 +08:00
Johannes Altmanninger
3274dbacf4 Fix autosuggestions for time 2019-12-20 09:21:17 +01:00
Mahmoud Al-Qudsi
664d6fb132 Convert time to a job decorator 2019-12-19 23:02:23 -06:00
Mahmoud Al-Qudsi
ca18d88138 Switch to C++11 chrono's steady_clock for portability reasons
`clock_gettime()` is apparently not readily available on many fairly
recent *nix systems.

Closes #6440
2019-12-19 21:26:46 -06:00
Johannes Altmanninger
feb87bbda8 __fish_man_page: ignore prefixing variable assignments 2019-12-19 23:44:58 +01:00
Johannes Altmanninger
1410f938aa read: discard IFS delimiters before the last token
Do this only when splitting on IFS characters which usually contains
whitespace characters --- read --delimiter is unchanged; it still
consumes no more than one delimiter per variable. This seems better,
because it allows arbitrary delimiters in the last field.

Fixes #6406
2019-12-19 23:44:58 +01:00
ridiculousfish
0531c02ce4 Remove 'user_supplied' flag for io_fd_t
user_supplied was used to distinguish IO redirections which were
explicit, vs those that came about through "transmogrphication." But
transmogrification is no more. Remove the flag.
2019-12-19 14:14:23 -08:00
Fabian Homborg
22b2dbd97d functions/history: X is incompatible with SDMV, not C
"-C" is short for "--case-sensitive", which is entirely okay with "--delete".

The one that isn't okay is "-X", which is short for "--Clear".

Seen on gitter.im
2019-12-19 20:59:17 +01:00
Mahmoud Al-Qudsi
ec11bd4af7 [make] add default all in addition to catch-all % 2019-12-18 22:13:41 -06:00
Mahmoud Al-Qudsi
2a14199421 Replace pseudo all target with catch-all %
This should fix the CI broken in-tree builds.
2019-12-18 22:11:02 -06:00