Commit Graph

12768 Commits

Author SHA1 Message Date
ridiculousfish
12d0afa929 Fix some build warnings in fish_tests 2020-07-12 11:41:06 -07:00
ridiculousfish
2e5222ffe8 Finish renaming job tree to job group
Some "tree" terminology was still there.
2020-07-11 17:05:42 -07:00
ridiculousfish
765c48afa4 Migrate the notion of 'foreground' from job to job group
Whether a job is foreground is a property of its pgid, so it belongs
naturally on the job group.
2020-07-11 17:01:52 -07:00
Gokul Soumya
0c72e65071 Update changelog regarding _whatis_current_token binding 2020-07-12 00:15:25 +02:00
Gokul Soumya
ec0c3f349d Return early if token is empty in whatis_current_token 2020-07-12 00:15:24 +02:00
Gokul Soumya
5f782cef7d Show builtin description with whatis_current_token 2020-07-12 00:13:51 +02:00
Gokul Soumya
e665f9b523 Precedence for functions over commands in whatis_current_token 2020-07-12 00:11:37 +02:00
Gokul Soumya
d0ce5fe943 Show function description if available with whatis_current_token
By default __fish_whatis_current_token is bound to ALt-W
2020-07-12 00:11:37 +02:00
Johannes Altmanninger
1f8c9a5d42 __fish_print_help: handle [ and : 2020-07-12 00:11:37 +02:00
Charles Gould
c2fe319af0 fish_config: 'Webify' color definitions
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`.
2020-07-11 13:51:52 -07:00
Johannes Altmanninger
2083acec2e
Merge pull request #7187 from MaxVerevkin/master
create_manpage_completions.py: introduce TypeScdocManParser; refactor
2020-07-11 18:08:51 +02:00
MaxVerevkin
aff2e76021 create_manpage_completions.py: introduce TypeScdocManParser which is capable of parsing scdoc manpages
This greatly improves generated completions for scdoc man pages, see #7187.
2020-07-11 17:39:36 +02:00
MaxVerevkin
d3661b3808 create_manpage_completions.py: add .SH and .UN sections in Type2ManParser
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
2020-07-11 17:36:07 +02:00
MaxVerevkin
23c78a74e4 create_manpage_completions.py: do not use '|' in '[]' in regex 2020-07-11 15:52:16 +02:00
MaxVerevkin
4f867ce513 create_manpage_completions.py: refactor 2020-07-11 15:52:16 +02:00
MaxVerevkin
d1ad143cf1 create_manpage_completions.py: refactor: clean up parse_manpage_at_path 2020-07-11 15:52:16 +02:00
MaxVerevkin
75f93a590e create_manpage_completions.py: refactor: clean up parse_and_output_man_pages 2020-07-11 15:52:16 +02:00
MaxVerevkin
0d863378ea create_manpage_completions.py: refactor: remove unnecessary 'skip' 2020-07-11 15:52:16 +02:00
Johannes Altmanninger
0c9e651fdf create_manpage_completions.py: use correct capture group 2020-07-11 15:46:33 +02:00
ridiculousfish
225470493b Make parse_token_type_t an enum class
Improves type safety.
2020-07-09 14:22:04 -07:00
Fabian Homborg
a40c82dcc4 Check if create_manpage_completions was installed
Fixes #7183.
2020-07-09 18:35:41 +02:00
Fabian Homborg
8a6a265c3e docs: Add word splitting example 2020-07-09 18:35:41 +02:00
ridiculousfish
7ea396ab3f Remove lrand48 checks and support
lrand48 is no longer used.
2020-07-08 11:00:12 -07:00
Mahmoud Al-Qudsi
50e2a8dd72 [dnf] Fall back to dnf repolist when no sqlite3
[ci skip]
2020-07-08 11:24:29 -05:00
Mahmoud Al-Qudsi
4a5f0f3a3d Fix missing references when manually linking against curses
When CMake's own curses logic fails to find curses/ncurses, we fall back to
pkg-config and manually link the required libraries. Some platforms (RHEL 6,
see #6587) require CURSES_EXTRA_LIBRARY=tinfo, so we link against libtinfo
if it's found but are happy to continue without it if it doesn't exist.

Closes #6587
2020-07-08 10:58:41 -05:00
ridiculousfish
35cb449aa1 Make parse_statement_decoration_t a class enum 2020-07-07 16:28:39 -07:00
ridiculousfish
71a8eb0aa4 parsed_source_t to hold an ast directly instead of through unique_ptr
We have untangled the dependency loop and so now parsed_source_t no longer
requires indirection.
2020-07-07 16:16:45 -07:00
ridiculousfish
5308223212 Migrate next_parse_token into token_stream_t
Cleaning up parse_tree.cpp with an eye to remove it.
2020-07-07 14:01:01 -07:00
ridiculousfish
72e35af381 Remove preceding_escaped_nl
It's no longer necessary for fish_indent
2020-07-07 13:48:35 -07:00
Mahmoud Al-Qudsi
8d25ed962c Add early abortion of completion match attempt 2020-07-06 23:08:19 -05:00
Fabian Homborg
0b3b4f3d91 Add code of conduct
This adopts the Contributor Covenant Code of Conduct 2.0

We don't currently have an email address for enforcement, once that's set up we can
add it in.

[ci skip]
2020-07-06 20:13:01 +02:00
Fabian Homborg
213ac15caa Remove duplicate color
This was always wrong, but the new(er) angular actually complains
about it.
2020-07-06 20:10:01 +02:00
Fabian Homborg
4981115f73 webconfig: Fix "then" arguments
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
2020-07-06 20:10:01 +02:00
Fabian Homborg
3f904b6a59 webconfig: Replace unsafe binding with filter
ng-bind-html-unsafe was apparently removed.
2020-07-06 20:10:01 +02:00
Fabian Homborg
9cfcdfa105 WIP Update angular to something from after the stoneage 2020-07-06 20:10:01 +02:00
David Adam
4a35248465 docs/bind: make list formatting consistent 2020-07-06 20:50:19 +08:00
David Adam
1b121bd9a6 docs/jobs: add example output and remove spurious header 2020-07-06 20:48:13 +08:00
Mahmoud Al-Qudsi
02d0380e6b Make fish_exit workaround for forced exit not SIGHUP-specific 2020-07-05 23:17:21 -05:00
Mahmoud Al-Qudsi
04c6442dcc Allow fish_exit to run even on fish SIGHUP
We were previously aborting the main event loop before calling fish_exit
in the event of a SIGHUP. This patch causes the SIGHUP to be stored in a
separate state variable from a regular "must exit" condition so the
associated event can be fired before we terminate the loop.

All streams are redirected before the event is called to prevent a
SIGTTIN/SIGTTOU due to the user script reading/writing from a disposed
tty.

Closes #7014
2020-07-05 22:18:21 -05:00
Mahmoud Al-Qudsi
791c4fb1dd Fix unused return value errors in fish tests
This error only happens on recent versions of gcc, see previous
commit e6bb7fc973 for more info.

Instead of using `ignore_result()` here, I've added a `system_assert`
function/macro that mimics the behavior of all the other `system()`
calls in the file.
2020-07-05 22:18:21 -05:00
Shun Sakai
d24a14744c
Update apk-tools completions (#7171)
* 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.
2020-07-05 18:22:36 -05:00
ridiculousfish
bd4c4a9a9c Stop weak linking pre 10.9 macOS symbols
Previously fish weak-linked wcsdup, wcsncasecmp, and wcscasecmp.
This enabled fish to be used on 10.6. However the minimum Mac version
is now 10.9, where these symbols are available.
2020-07-05 12:49:29 -07:00
ridiculousfish
6976d0ee7e Simplify infinite loop fix when parsing "a="
This reworks the "a=" detection to be simpler.
If we detect a variable assignment that produces an error,
simply consume it.

We also take the opportunity to not highlight it as an error,
and add some tests.

Original commit is 1ca05d32d3.
2020-07-05 12:15:18 -07:00
ridiculousfish
23224f71ce Make some variables local which did not need to be static 2020-07-05 12:15:18 -07:00
Mahmoud Al-Qudsi
fb4967945a fixup! Put -Wno-redundant-move behind a compiler check
Use -Werror in the CMake test because the compiler check passes even
if warnings are emitted.
2020-07-05 13:31:28 -05:00
Johannes Altmanninger
1ca05d32d3 Fix infinite loop when parsing "a="
Typing that command in an interactive prompt would make the highlighter thread
eat up CPU and memory.  Probably not the right fix; I think the token should
already have been consumed when the error is detected, then there is no need
to consume it when unwinding.
2020-07-05 13:19:48 +02:00
Johannes Altmanninger
ada03d3509 Correct pager size when command line soft-wraps
When selectiong a large completion entry in the pager, it would clobber the
prompt. To reproduce, first run this command

	complete -c : -xa '(
		# completion entries that,  when applied to the commandline
		# need one, two, or three lines respectively
		echo 1
		echo 2(string repeat -n (math $COLUMNS - 5) x)
		echo 3(string repeat -n $COLUMNS x)
		printf %s\n n(seq $LINES)
	)'

then type ": " and hit Tab repeatedly. When cycling through completion
entries, observe that fish always tries to render the pager with the same
size, even though the number of lines occupied by the command line buffer
changes due to soft wrapping.

Fix this by rendering the pager after the command line has been rendered, so
we know how many lines we have left.
2020-07-05 08:55:17 +02:00
Johannes Altmanninger
826db22dbf Adjust deprecated stderr redirection in fish_xgettext.fish 2020-07-05 08:55:11 +02:00
Mahmoud Al-Qudsi
fe2da0a94f Put -Wno-redundant-move behind a compiler check
This fixes a warning under Ubuntu 18.04's default gcc
(cc++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0)
2020-07-04 21:14:43 -05:00
Mahmoud Al-Qudsi
e628ba51e7 Remove repeated calculation of fixed string's length in a loop 2020-07-04 20:38:06 -05:00