Commit graph

14212 commits

Author SHA1 Message Date
Collin Styles
0abbd2bc2f Add completions for git-revert sequencer subcommands 2021-06-18 20:49:34 +02:00
Collin Styles
15fdfb5afe Add completion for --abbrev-ref option to git-rev-parse 2021-06-18 20:49:34 +02:00
Collin Styles
c9f397b968 Remove invalid completion for git-describe
The `__fish_git_unique_remote_branches` function isn't applicable here
since `git describe` won't know what to do with a remote branch without
the remote prefix. For example, if there is a branch called
`origin/my-branch`, you can't execute `git describe my-branch` until the
branch is checked out locally. In other words:

Good: `git describe origin/my-branch`
Bad:  `git describe my-branch`
Good: `git switch my-branch; git describe my-branch`
2021-06-18 20:49:34 +02:00
Collin Styles
7d5c64a731 Fix completions to cargo's --example option on macOS
The completions for the `--example` option are generated using `find`.
The `find` utility on macOS will produce the following output when the
path argument has a trailing slash:

```
~/bat $ find ./examples/
./examples/
./examples//cat.rs
./examples//advanced.rs
./examples//simple.rs
./examples//list_syntaxes_and_themes.rs
./examples//yaml.rs
```

And will produce this output if the path does NOT have a trailing slash:

```
~/bat $ find ./examples
./examples
./examples/cat.rs
./examples/advanced.rs
./examples/simple.rs
./examples/list_syntaxes_and_themes.rs
./examples/yaml.rs
```

The extra slash after `examples` ends up in the completion suggestions
which is incorrect:

```
~/bat $ cargo run --example <TAB>
/advanced  /cat  /list_syntaxes_and_themes  /simple  /yaml
```

Unlike on my Linux box where `find` doesn't output the trailing slash:

```
~/bat $ cargo run --example <TAB>
advanced  cat  inputs  list_syntaxes_and_themes  simple  yaml
```

Importantly, I get the same (correct) output on Linux even without the
trailing slash in the path argument to `find`.
2021-06-15 21:22:44 +08:00
Johannes Altmanninger
701b7450df __fish_is_first_arg: only look at current process
This fixes the completions in

	btrfs command | btrfs <TAB>

See #8060
2021-06-15 03:38:52 +02:00
Johannes Altmanninger
f0de75ddd9 completions/git: complete normal files on "git restore -sHEAD "
A full "git ls-files" is slow on larger repositories; this makes the
common case (desired path exists on file system) faster.
2021-06-15 03:27:55 +02:00
Johannes Altmanninger
585dc16a66 completions/git: complete normal files on "git checkout -- "
This can give false positives but only if used on directories that
mix tracked and untracked files. The performance is better than
listing all tracked files, and in any case we're pretty far from a
correct solution that knows the target Git commit, so this seems like
good compromise.
2021-06-15 03:27:55 +02:00
Johannes Altmanninger
2bc8057780 Remove redundant parens 2021-06-15 03:27:55 +02:00
Johannes Altmanninger
4908f9bb40 Remove spurious character escape 2021-06-15 01:19:01 +02:00
ridiculousfish
1c20bdcbf9 Minor improvements to file_id_t 2021-06-13 17:20:04 -07:00
ridiculousfish
ba2e7db7e8 Notice when exit has been run from within fish_prompt
This allows `exit` to tell the reader to stop, when run inside
fish_prompt. Fixes #8033.
2021-06-12 10:20:49 -07:00
Fabian Homborg
9e46d49dd9 webconfig: Remove tab top border in dark mode 2021-06-10 21:26:03 +02:00
Fabian Homborg
e571902a85 webconfig: Hover more things
The buttons were already supposed to highlight on hover, but the color
difference was barely visible. Crank that up.

Also add a hover color to the tabs, colorschemes, prompts, functions.

The big clickable things.
2021-06-10 21:25:40 +02:00
Fabian Homborg
f6a6537f7b css: Some minor adjustments
Make borders less bright in dark version, add some padding to the body.
2021-06-10 21:00:18 +02:00
Fabian Homborg
f073bf59a8 CHANGELOG for 3.3 2021-06-10 16:49:28 +02:00
Fabian Homborg
7059eaa4ab Revert "Disallow escaped characters in variable expansion"
This reverts commit 555af37616.
2021-06-10 16:46:17 +02:00
Fabian Homborg
d2b210ee15 docs: Mention all set_color modifiers
This spoke of "--bold" and "-b", which are two different things - "-b"
is short for "--background", bold is "-o".

Instead let's just mention the long versions of all the switches.

See #8053.
2021-06-10 10:50:51 +02:00
Fabian Homborg
95103893e6 output: Allow "--background foo" and "-b foo" for background colors
This only accepted "--background=". Really what we need to do is do an
actual getopt, but that wants a null-terminated array and is tightly
coupled to set_color.

Fixes #8053.
2021-06-10 10:42:30 +02:00
Fabian Homborg
695027234b completions/git: Complete untracked files immediately
Fixes #8049
2021-06-08 08:53:49 +02:00
Fabian Homborg
71b9463165 docs: Some tweaks to "Syntax overview" 2021-06-06 21:36:04 +02:00
Fabian Homborg
b0b8cb0129 docs: Move color variables to interactive
A bunch of our variables are only relevant for interactive use, but
this is two whole sections on them. Simply move them inside "Syntax
highlighting" and leave the link in Special Variables.
2021-06-06 17:43:06 +02:00
David Adam
f90577ddf6 CHANGELOG: work on 3.3.0 2021-06-06 23:24:31 +08:00
Fabian Homborg
a9b4ad4b9f README: Document build options 2021-06-06 12:21:44 +02:00
David Adam
7aefaff298 CMake/CheckIncludeFiles: use correct variable name
Merged from https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1538

This file can be dropped once the minimum version of CMake for fish is
3.11.0.
2021-06-06 18:10:03 +08:00
Fabian Homborg
775c5f01b4 CHANGELOG locale coercion 2021-06-06 09:31:40 +02:00
Fabian Homborg
046db09f90
Try to set LC_CTYPE to something UTF-8 capable (#8031)
* Try to set LC_CTYPE to something UTF-8 capable

When fish is started with LC_CTYPE=C (even just effectively, often via
LC_ALL=C!), it's basically broken. There's no way to handle non-ASCII
characters with a C locale unless we want to write our
locale-independent replacements for all of the system functions.

Since we're not going to do that, let's try to find *some locale* for
LC_CTYPE.

We already do that in __fish_setlocale, but that's

- a bit of a weird thing that reads unstandardized system
  configuration files
- allows setting locale to C explicitly

So it's still easily possible to end up in a broken configuration.

Now, the issue with this is that there is (AFAICT) no portable way to
get a list of all allowed locales and C.UTF-8 is not standardized, so
we have no one locale to fall back on and are forced to try a few. The
list we have here is quite arbitrary, but it's a start.

Python does something similar and only tries C.UTF-8, C.utf8 and
"UTF-8".

Once C.UTF-8 is (hopefully) standardized, that will just start
working (tm).

Note that we do not *export* the fixed LC_CTYPE variable, so external
programs still have to deal with the C locale, but we have no real
business messing with the user's environment.

To turn it off: $fish_allow_singlebyte_locale, if set to something true (like "1"),
will re-run the locale initialization and skip the bit where we force
LC_CTYPE to be utf8-capable.

This is mainly used in our tests, but might also be useful if people
are trying to do something weird.
2021-06-06 09:28:32 +02:00
Fabian Homborg
e57c998d4c webconfig: Make a bit nicer on smaller screens
Actually remove the margins, distribute the color choices evenly and
switch to small mode a bit earlier.
2021-06-05 11:46:23 +02:00
Fabian Homborg
48acd316c8 CHANGELOG
Document the last few changes and move some of the things out of
"Interactive" into more specific categories. If it's to do with
completions, it goes into completions. Bindings? How about "Bindings"?
2021-06-05 11:32:22 +02:00
Fabian Homborg
7a5e192607 Make background a bit more blue, brighter 2021-06-05 11:17:53 +02:00
Fabian Homborg
c2b35d3171 Adjust colors a teensy bit
Make a bit less ultra-dark blue
2021-06-05 11:17:53 +02:00
Fabian Homborg
64bbc8b304 webconfig: Dark mode 2021-06-05 11:17:53 +02:00
Fabian Homborg
606a8a7a1a Darkmode for docs
This uses the prefers-color-scheme media query to pick between dark and light mode,
so the user automatically gets the colorscheme they prefer.
2021-06-05 11:17:53 +02:00
Fabian Homborg
155160e49b Msys also has a weird kill
Like Cygwin, it doesn't feature an option to list the signals, so we
simply hardcode them.

Fixes #8046.
2021-06-05 11:15:53 +02:00
Fabian Homborg
1fc6f77378 docs: Make toctree more spread out
Easier to tap on a phone
2021-06-03 20:55:36 +02:00
Fabian Homborg
a17f7468b7 docs: Make sidebar more readable
and tappable - more line-height, larger fonts in narrow mode.

In turn the search box really doesn't need that massive margin above.
2021-06-03 20:55:36 +02:00
Fabian Homborg
44a6795ead webconfig: Set image height explicitly
Chrome says that's better, presumably because it can then tell how
large the image is before it's loaded. Not that this tiny image really
is a massive problem, but let's be good, not acceptable.
2021-06-03 20:55:36 +02:00
Fabian Homborg
5f4dfd9951 webconfig: Remove weird position: absolute
This made the current prompt appear directly under the tab,
disregarding the padding.

That means it looked inconsistent with the colors. (note there's still
less padding on the side, but at least that allows more actual content
- prompts are often fairly wide)
2021-06-03 20:55:36 +02:00
Fabian Homborg
46208ff276 CHANGELOG 2021-06-03 10:07:54 +02:00
Fabian Homborg
4e718506e3 Vi-bindings: Use fish_clipboard_copy
This has one slight behavioral change: Even with xsel, it now copies
to the clipboard, not the primary. I would imagine anyone who cares
about the primary selection has customized fish_clipboard_copy and
because we never got a bug about this not supporting anything but
xsel (and errorring out if it's not available!) this is probably
unused.

So now we support all the clipboard integration things, and we use the clipboard.
2021-06-03 10:04:30 +02:00
Fabian Homborg
c18c7a4ce4 Document vi-visual mode keys 2021-06-03 10:03:43 +02:00
mtoohey31
6ca9f9ee38 fish_vi_key_bindings: bind s to follow vim visual behaviour
This change adds a binding that sets the s key's behaviour to match
the c key's in visual mode. This mirrors vim's behaviour (see `:h v_s`
in vim or neovim).
2021-06-03 09:57:22 +02:00
Fabian Homborg
a633889244 ls: Ignore ruby colorls
Apart from OpenBSD's "colorls" that is basically an ls that can do
color, there's also a ruby tool called "colorls" that's closer to exa.

Ignore that one since the options it understands are quite different
and I'm betting it's slower (given my experience with ruby tools).

See #8042.
2021-06-03 09:54:20 +02:00
Fabian Homborg
344bd63e0b webconfig: Remove unneeded inline style
This makes changing it harder and is unnecessary
2021-06-02 17:57:48 +02:00
Fabian Homborg
850419d127 docs: Style footnote-references like footnotes
Emphasizes that they belong together
2021-06-02 17:48:16 +02:00
Fabian Homborg
1fed36d005 docs: Deduplicate some styles 2021-06-02 17:47:07 +02:00
Fabian Homborg
843c9383aa docs: Remove non-functional link 2021-06-02 17:33:55 +02:00
Fabian Homborg
bc00188ca8 docs: Make footnotes stand out a teensy bit 2021-06-02 17:12:45 +02:00
Fabian Homborg
553ce7a006 docs: Inherit some more background colors
Unfortunately sphinx hardcodes these again in classic.css, and if we
want to change them we need to make these the same again.
2021-06-02 17:12:45 +02:00
Fabian Homborg
884768dded docs: Make some background-colors dependent
This is so we can more easily change the background.
2021-06-02 17:12:45 +02:00
David Adam
8e51123574 CHANGELOG: work on 3.3.0 2021-06-02 22:37:48 +08:00