Commit Graph

14639 Commits

Author SHA1 Message Date
ridiculousfish
15cee66df1 Wrap even more stuff in anonymous namespaces 2021-09-30 11:33:03 -07:00
ridiculousfish
89c02cfe81 Put lots of things in anonymous namespaces
This is an attempt to help prevent ODR violations by making stuff local
to a file, instead of emitting weak symbols.
2021-09-30 11:33:03 -07:00
ridiculousfish
accba09709 Remove entry_was_evicted from LRU
This was no longer used. This allows us to remove the CRTP bits as well.
2021-09-30 11:33:03 -07:00
ridiculousfish
a6010519df Put ast_t::populator_t into an anonymous namespace
This is part of an effort to reduce the number of weak symbols, so we
can help prevent ODR errors. No functional change here.
2021-09-30 11:33:03 -07:00
ridiculousfish
799a2abac1 Add script to detect ODR violations
This is a little script that can be run manually to try and detect ODR
violations. It works by looking for weak symbols in .o files where the
symbol has the same name and different sizes.
2021-09-30 11:33:03 -07:00
Fabian Homborg
78fcbed6f2 wcsfilecmp: Skip towlower/upper if unnecessary
Also for the glob version, because this is just a performance thing.

Makes `echo **` 20% faster - 100ms to 80ms for the fish repo.

This also applies to the future `path` builtin.

Still not a speed demon, but this is a very very easy win.

Now we probably gotta do globbing all in string instead of wcs2stringing ourselves to death.
2021-09-30 18:09:58 +02:00
Fabian Homborg
4ffabd44be Don't add expansion error offset twice
Like the $status commit, this would add the offset to already existing
errors, so

```fish
(foo)
(bar)

something
```

would see the "(foo)" error, store the correct error location, then
see the "(bar)" error, and *add the offset of (bar)* to the "(foo)"
error location.

Solve this by making a new error list and appending it to the existing
ones.

There's a few other ways to solve this, including:

- Stopping after the first error (we only display the first anyway, I
think?)
- Making it so the source location has an "absolute" flag that shows
the offset has already been added (but do we ever need to add two offsets?)

I went with the simpler fix.
2021-09-30 18:09:58 +02:00
Fabian Homborg
6774a514fa Don't set error offset for $status
This would break the location of any prior errors without doing
anything of value.

E.g.

```fish
echo foo | exec grep # this exec is not allowed!

$status

somethingelse # The error might be found here!
```

Would apply the offset of `$status` to the offset of `exec`, locating
the error for `exec` somewhere after $status!
2021-09-30 18:09:58 +02:00
Adam Skoufis
d619d79117
Fix typo in set_colors command documentation (#8321)
* Fix typo in `set_colors` command documentation
* Replace `It` with `VALUE` to reduce ambiguity
2021-09-29 08:17:21 -07:00
Aaron Gyes
35bd06a13e fish_config: adjust output
Do not show an error on `fish_config prompt save` after removing a
`fish_right_prompt`
2021-09-29 03:15:37 -07:00
Aaron Gyes
f3b950157d Remove special case for fish_right_prompt in config.fish 2021-09-29 03:12:39 -07:00
Aaron Gyes
ed8c78c0ea Update docs, completions for funcsave
Remove long opt for -q, funcsave does not have so many options that
it's any help.
2021-09-29 03:08:10 -07:00
Aaron Gyes
fb32872f6b don't use __has_builtin
GCC doesn't have this until GCC 10. Just assume it exists, as
our compiler requirements mean it should exist.
2021-09-28 23:54:17 -07:00
Aaron Gyes
97bb53e32d Add likely() and unlikely() for our assertions
Allows the compiler to know our bespoke assert functions
are cold paths. This would normally occur somehow for real assert().
Assembly does appear it will save some branches.

Also don't worry about NDEBUG

(This doesn't matter because we rolled our own assert functions.
Thanks @zanchey.)
2021-09-28 23:39:54 -07:00
Aaron Gyes
a5978eade4 funcsave: add missing newlines 2021-09-28 22:22:21 -07:00
Aaron Gyes
3fd2da951e remove unused futimes check 2021-09-28 22:02:14 -07:00
Aaron Gyes
0b3d3de9bf Just add -UNDEBUG to disable NDEBUG. 2021-09-28 22:02:14 -07:00
Aaron Gyes
3a402b19b3 funcsave: delete files for non-existant functions, output actions unless -q
This allows for:

$ functions -e somefunc
$ funcsave somefunc

to work.
2021-09-28 22:01:07 -07:00
Fabian Homborg
69074c1591 fish_config: Remove right prompt in choose and save
If the new theme no longer has any.

Fixes #8314.
2021-09-26 15:34:04 +02:00
ridiculousfish
ecaf455277 sphinx-build to use multiple processes
sphinx-build supports the -j option to use multiple processes. Start using
it. This reduces the time to build the docs on my Linux box from 11 seconds
to about 4.

Note this doesn't work on macOS since -j is ignored there (see sphinx-build
PR 6879).
2021-09-25 12:17:46 -07:00
takeokunn
d2ca6ed564 Add dart completion 2021-09-25 10:36:11 -07:00
ridiculousfish
0c06ca3c3f Mark parser_t::principal as const 2021-09-24 21:09:28 -07:00
ridiculousfish
4f466cb916 broken-symbolic-link test to enter a new directory
This was previously dependent on whatever directory we happened to be
in.
2021-09-24 17:35:45 -07:00
Fabian Homborg
3b74f6e0c6 tests/bind: Disable one flakey test
This one annoys the living fudge out of me, and I've never seen it
fail in earnest.
2021-09-24 20:41:09 +02:00
Fabian Homborg
f4c8dc72a7 docs: Some minor stuff in fish_for_bash_users 2021-09-24 20:32:29 +02:00
Fabian Homborg
615e8b2e8b docs: Expand section on heredocs
This should give a better rationale for why fish doesn't have them.
2021-09-24 20:29:57 +02:00
Aaron Gyes
5fc9a3c31e exec.h: remove unused declaration 2021-09-24 09:30:25 -07:00
Aaron Gyes
c077230b11 .clang_tidy: turn off cert-dcl21-cpp, add some others.
cert-dcl21-cpp is pretty bogus, doing as it says can force a copy.

https://reviews.llvm.org/D33531

Turn on some good ones.
2021-09-24 09:30:25 -07:00
Fabian Homborg
38f20f445b tests/tmux: Do actually loop 25 times 2021-09-24 18:27:14 +02:00
Fabian Homborg
6c8b0a1245 Reapply -F
This was forgotten in a40a35cc52.

Sorry!
2021-09-24 18:25:27 +02:00
Fabian Homborg
113e91ab9a Use a local variable
Otherwise this is annoying on upgrade
2021-09-24 18:17:49 +02:00
Fabian Homborg
5f5bd03911 functions/ls: Work around Terminal.app not setting $COLORTERM
Fixes #8309
2021-09-24 18:15:48 +02:00
ridiculousfish
0562e599a6 isolated-tmux to more reliably initialize and other fixes
Prior to this change, tmux based tests would call 'isolated-tmux' which would
initialize tmux on first call, an admitted "evil hack." Switch to requiring
an explicit call to 'isolated-tmux-start' which then defines 'isolated-tmux'
and other functions. Add some loop-until-prompt logic into
'isolated-tmux-start'. This improves reliability of the tmux tests on systems
under load; at least it makes the tests pass in the background on my Mac.

Remove the '$sleep' variable, to be replaced with 'tmux-sleep'.
2021-09-24 08:07:17 -07:00
ridiculousfish
13fd3f7a76 Pass in variables directly to screen_t::update
This fixes a TODO. No functional change.
2021-09-23 10:32:55 -07:00
ridiculousfish
8878672014 Switch screen.h free functions to member functions on screen_t
Refactoring only, no functional change here.
2021-09-23 10:32:54 -07:00
ridiculousfish
26f3cee86c History variable expansion to use passed-in vars
This eliminates a call to principal_parser.
2021-09-23 10:29:34 -07:00
Fabian Homborg
45714eb29d Add function scope to read as well
Fixes #8295.
2021-09-23 17:12:37 +02:00
Fabian Homborg
8b093e2651 Remove guessed_emoji_width
Just guess anew when it's not set.

(this still uses the value of $fish_emoji_width, but clamped to 1 or 2
- we could also guess if it's an unusable value, but that's a
different issue and tbh this variable is becoming less and less useful
as time moves on and things move to the new widths by default)

Fixes #8274.
2021-09-23 15:31:05 +02:00
Fabian Homborg
07e512ecd8 completions/git: Treat T files same as modified
This is weirdly undocumented (as of git 2.33.0), but `git status` prints a "T" state if
the file has its "T"ype changed, e.g. from a regular file to a symlink.

For our purposes that's just another kind of modification.

Fixes #8311.
2021-09-23 15:23:43 +02:00
Fabian Homborg
bb115c847e Handle backspaces for visible width
This makes it so we treat backspaces as width -1, but never go below a
0 total width when talking about *lines*, like in screen or string
length --visible.

Fixes #8277.
2021-09-23 12:58:35 +02:00
Max Nordlund
85ea9bf781
Hide whatis database building from the user (#8310)
* Hide whatis database building from the user

It's really an internal detail, but shows up in prompts that display how many
background jobs are running.

By disowning it keeps running but won't show up in `jobs` or get killed if the user
exits the shell.

* Update __fish_apropos.fish
2021-09-23 10:59:44 +02:00
Fabian Homborg
82a809e2db Check for tputs type via cmake
Instead of testing for ncurses and netbsd.

Fixes #8087.
2021-09-23 10:41:54 +02:00
Aaron Gyes
5a685c16c5 Fix build 2021-09-21 18:33:14 -07:00
Aaron Gyes
933bb96983 remove accidental change 2021-09-21 18:26:44 -07:00
Aaron Gyes
db72a05e89 Tighten up includes, some typedefs -> using
clangd was unable to resolve some symbols
2021-09-21 18:05:53 -07:00
Aaron Gyes
b4b84f6847 builtin.cpp: don't check exit code if not a normal exit
Fixes #8308
2021-09-21 17:49:08 -07:00
Aaron Gyes
cedf9c4d90 builtin_read.cpp: include <termios.h> not "termios.h" 2021-09-21 17:49:08 -07:00
Pascal Huber
3099d7bdeb Fix man completion for BSD's mandoc 2021-09-21 12:34:21 +02:00
ridiculousfish
0a277bf8c3 cmake: Group test targets into tests folder in IDEs
This simplifies fish project as shown in IDEs. No change to command line
build systems.
2021-09-20 12:53:12 -07:00
Lia Lenckowski
1d7036d19f Add completions for cpupower 2021-09-20 17:46:15 +02:00