Fixes some potentially unsafe uses of direct substitution into regex
expressions and also switches some completions to regex-based now that
there is a safe way of using it.
In writing the completion script for openocd I found the need to
complete paths at the command-line as if they were relative to a
path other than the current $PWD. Given that `$PWD` is currently
global in fish (i.e. no side-effect free `cd` within a subshell)
this is probably good to have for other completions too.
This also fixes a bug in support for explicitly supplying the
description for completions via a `$argv` parameter, which prefixed
the description with `\t` (which is correct) except it did so in
the local scope within an `if` statement, meaning the changes never
had any effect and in the output the description was directly
concatenated to the completions, instead of separated by a tab.
Incorrectly assumed that pandoc uses XDG_CONFIG_HOME, it turns out the
path is hard-coded as $HOME/.pandoc unless explicitly otherwise
specified in the command-line.
Don't attempt to complete against package names if the user is trying to
enter a switch to speed things up.
Also work around #5267 by not wrapping unfiltered `all-the-package-name`
calls in a function.
We do a bunch of escaping before to make `eval` work, and that needs to be removed as well or fragment-urls don't work.
This reverts commit e9568069a7.
Use clang/clang++'s own autocompletion support to complete arguments. It
is rather convoluted as clang generates autocompletions for a portion of
the current token rather than the entire token, e.g. while `--st` will
autocomplete to `--std=` (which is fine by fish), `--std=g` will
autocomplete to `gnu...` without the leading `--std=` which breaks fish'
support for the completion.
Additionally, on systems where clang/clang++ is the system compiler
(such as FreeBSD), it is very often for users to invoke a newer version
of clang/clang++ installed as clang[++]-NN instead of clang. Using a
monkey-patched version of `complete -p` to support that without breaking
(future) completions for commands like `clang-format`.
Closes#4174.
If you're using the old binding that only clears the commandline and
doesn't preserve its contents and start a new line, you can use
```fish
bind \cc "commandline -f cancel; commandline ''"
```
instead.
Closes#4298.
For some weird reason we only used $editor if it wasn't empty, but
then failed to fail if it was.
This will now print an error and use fish, just like if the $EDITOR
value is invalid in any other way.
Fixes#5257.
This is a wrapper that calls kitty to dynamically provide completions,
as generated by kitty itself, via `kitty + complete setup fish`.
ref: https://sw.kovidgoyal.net/kitty/#fish