New fish_indent does that too, so this will make any future reformatting
diffs smaller.
Done using either of:
perl -pi -e 'undef $/; s/\n*$/\n/' share/**.fish
kak -n -f '<a-/>\n*<ret>d' share/**.fish
fish's internal completion logic is much smarter than the globbing in this
function, so let's just reuse "complete -C", and filter directories and
files with the given suffix.
Thanks to @Kratacoa for reporting on Gitter.
Using "complete -C" works well no prefix is given. Since in this repository
only the openocd completions pass a prefix, I left the prefix-case as is.
It could probably be improved and simplified as well. The prefix argument was
introduced to avoid cd's side effects inside a completion. Using cd is tempting
though because it would allow to use the same logic as without a prefix.
"repaint" here is a bit of a misnomer. It *doesn't* re-highlight, that
just happens on its own.
It re-runs the prompt, which can take quite a while (depending on the
configuration), and which is also useless in this context as this
isn't something the prompt will be reacting to (theoretically it
could, but I doubt the utility of displaying "PASTE" for a few milliseconds).
The external-commands-only completion was briefly added in 3.1.0 and removed
in 3.1.1 (see #6798), which means we can remove some dead code.
Maybe we should just remove __fish_complete_external_command - it could break
users, but then again, we don't really have a way to stop people from starting
to use this deprecated function. The underscores ought to communicate that
this is function is private to fish but that is not enforced.
pacman -U is intended to be used with (among others) files like this:
# pacman -U ./linux-headers-5.6.2.arch1-2-x86_64.pkg.tar.zst
Thus, let's enable file path completion for this kind of operation.
If it can't recognize the DE, xdg-open uses a "generic" way of opening
things where it doesn't spawn off a DE-provided utility like kde-open.
This sounds great, but it fails to fork and therefore blocks the
terminal.
So we start it in the background and disown it.
Fixes#7215.
a) they can screw up our expected output/behavior
b) they can blow up your system
In my case, the unit tests were calling Pantheon's fish integration
script which would then proceed to blow up dbus with messages about each
individual test completing.
The colors defined in `colorutils.js` are specified in
fish format, and therefore RGB values lack the leading
`#` character and do not fully follow the html/css spec
(w3.org/TR/css-color-4/#typedef-hex-color).
Web config sends these values as-is to the browser,
without first converting to a browser-friendly format.
While this (somehow) works for the most part, a few
colors get lost along the way and do not display in
the customization selector nor in the preview when
selected. This behavior was seen in Firefox.
To fix this, let's prepend the missing '#' character
to all RGB colors defined in `colorutils.js`.
This improves some generated completions, for example:
diff -u completions.old/g3topbm.fish completions.new/g3topbm.fish
+complete -c g3topbm -o stop_error -d 'This option tells g3topbm to fail when it finds a problem in the input'
-complete -c g3topbm -o stop_error
This used to use "success", which was our own thing, but which I can't
get working.
So instead we just use ".then", which only passes one object as an
argument that then contains all the other data we use.
This should be enough to complete the port to angular 1.8
* Update apk-tools completions
Add completions of options of it's subcommands.
The completions of deprecated options is unimplemented.
* Fix installed package listing for apk-tools
An error occurs when the local cache does not exist, so fixed this.