Commit graph

19354 commits

Author SHA1 Message Date
Peter Ammon
ff72080aac
Changelog fix for #10624 2024-07-21 19:20:46 -07:00
Dezhi Wu
7308dbc7ad fish_indent: Prevent overwriting file with identical content
Fixes #10616
2024-07-21 18:57:48 +08:00
Lzu Tao
d9e5c6527f
Add description for git log -L 2024-07-20 13:54:21 -07:00
Mahmoud Al-Qudsi
fe63775ec5 string: Also escape new lines with --style=regex
This isn't *required* in the PCRE2 spec but it greatly increases the utility of
escaped regex strings at the commandline.
2024-07-16 17:05:11 -05:00
Mahmoud Al-Qudsi
6020fc497a Patch __fish_seen_argument to support --foo=arg
...when searching for long arguments by name/key.

Closes #10615.
2024-07-14 21:05:52 -05:00
Mahmoud Al-Qudsi
936f7d9b8d Add pexpect test for commandline --showing-suggestion 2024-07-07 22:34:36 -05:00
Mahmoud Al-Qudsi
b93e52079b Document commandine --showing-suggestion 2024-07-07 22:34:36 -05:00
Mahmoud Al-Qudsi
faf3b356f2 Add commandline --showing-suggestion
Returns 0 (true) in case an autosuggestion is currently being displayed.

This was first requested in #5000 then again in #10580 after the existing
workaround for this missing functionality was broken as part of a change to the
overall behavior of `commandline` (for the better).
2024-07-07 22:34:36 -05:00
Mahmoud Al-Qudsi
4730a04f25 Use NonZero types for 1-based line numbers
Since we have a mix of both 0-based and 1-based line numbers in the code base,
we can now distinguish between them by type alone. Also stop using 0 as a
placeholder value for "no line number available" except in explicit helper
functions such as `get_lineno_for_display()`.
2024-07-07 20:58:09 -05:00
Mahmoud Al-Qudsi
92cae9b576 Reduce size of Block to 32 bytes
Using a 32-bit integer to store the line number, as previously discussed.
2024-07-07 20:37:04 -05:00
Peter Ammon
9edd0cf8ee
Remove some now unused CMake bits 2024-07-07 16:06:45 -07:00
Peter Ammon
925382dc3e
Make make_pkg.sh create fat binaries again on macOS 2024-07-07 14:53:17 -07:00
Peter Ammon
c90862cd3d
Remove legacy Mac.cmake 2024-07-07 12:25:47 -07:00
Mahmoud Al-Qudsi
2bfa7db7bc Restructure __fish_seen_subcommand_from
Both are plenty fast enough, but this way the output of fish_trace isn't
completely taken over by the loops (seems fair since fish_trace probably gets
used rather heavily for completions).
2024-07-07 14:07:05 -05:00
Mahmoud Al-Qudsi
11be48fc38 Dramatically speed up npm/yarn completions
These go from a minimum of 5s in release mode to instantaneous. Worst case was
more than 30s when we didn't find enough matches to end early.
2024-07-07 14:05:12 -05:00
Mahmoud Al-Qudsi
a33d12fe53 Silence string match expression 2024-07-07 13:08:42 -05:00
Mahmoud Al-Qudsi
725bcef117 Update clasp completions (#10377)
Commit would not rebase cleanly.
Closes #10377.

Co-Authored-By: EmilyGraceSeville7cf <EmilyGraceSeville7cfg@gmail.com>
2024-07-07 12:21:37 -05:00
Mahmoud Al-Qudsi
f4b01bb638 Fix typo in npm completions: isntall -> install 2024-07-07 11:47:48 -05:00
Henrik Hørlück Berg
75da00df94
Fix short/long delimiter in string {match,replace}
- We use `()` not `[]`, as can be seen in e.g. `string split`
2024-07-06 16:18:14 +02:00
Peter Ammon
96c5139254
Build, codesign, and notarize macOS packages in CI
This adds a new workflow and script to build macOS packages in GitHub CI.
It also adds some documentation for the process.
2024-07-05 17:29:28 -07:00
Peter Ammon
e67ffc1a3b
Revert accidentally pushed commits
This reverts commit 81de0ee97b.
This reverts commit b4450f0ee5.
This reverts commit d5a128d342.
This reverts commit 580028816c.
2024-07-04 19:01:11 -07:00
Peter Ammon
81de0ee97b
try 1.79 2024-07-04 18:52:21 -07:00
Peter Ammon
b4450f0ee5
more 2024-07-04 18:08:22 -07:00
Peter Ammon
d5a128d342
more 2024-07-04 17:21:54 -07:00
Peter Ammon
580028816c
Add a script to automate macOS codesign 2024-07-04 15:35:29 -07:00
Fabian Boehm
70242ce38c reader: Fix external modes again
Missed in the port
2024-07-03 20:39:25 +02:00
Mahmoud Al-Qudsi
8b7597913e Add tests for string match/replace --max-matches 2024-06-30 17:51:50 -05:00
Mahmoud Al-Qudsi
f975e1c9e5 Document string match/replace --max-matches 2024-06-30 17:51:50 -05:00
Mahmoud Al-Qudsi
93f8385448 Add option to speed up string match/replace with --max-matches
I've often needed a way to get the last bit of performance out of unwieldy
completions that involve a lot of string processing (apt completions come to
mind, and I ran into it just now with parsing man pages for kldload
completions).

Since many times we are looking for just one exact string in the haystack, an
easy optimization here is to introduce a way for `string match` or `string
replace` to early exit after a specific number of matches (typically one) have
been found.

Depending on the size of the input, this can be a huge boon. For example,
parsing the description from FreeBSD kernel module man pages with

    zcat /usr/share/man/man4/zfs.4.gz | string match -m1 '.Nd *'

runs 35% faster with -m1 than without, while processing all files under
/usr/share/man/man4/*.4.gz in a loop (so a mix of files ranging from very short
to moderately long) runs about 10% faster overall with -m1.
2024-06-30 17:51:50 -05:00
Peter Ammon
204663f1b8
Minor cleanup of apply_var_assignments
Simplify the function signature and calls sites.
2024-06-30 15:27:49 -07:00
Peter Ammon
b5fd8d697b
Minor refactor of completer perform_for_commandline 2024-06-30 13:59:22 -07:00
Peter Ammon
8db7f6d8ba
Fix an errant tilde 2024-06-30 13:05:19 -07:00
visrosa
7260774fc3
Update less.fish
Preliminary work.  Might be important to check version if options I added aren't widely available.

Changed some short options to old-style options since they can't be grouped and don't even need spaces before their arguments, such as `less -ooutputfile` which creates `outputfile`.

The -Dxcolor argument is commented out because its arguments follow complex rules I didn't look into in depth
2024-06-30 13:00:19 -07:00
Joe Adams
2ad4454e52
give the two pages of the functions tab individual scrollbars 2024-06-30 12:50:00 -07:00
Nikita Bobko
e03e5e116d
fish_vi_key_bindings: add 'ab' and 'ib' vi text object
Part of #1842

The implementation is obviously isn't 100% vi compatible, but works good enough
for major cases

This commit depends on previous commits where jump-{to, till}-matching-bracket
motions were introduces
2024-06-30 11:58:10 -07:00
Nikita Bobko
67e190876a
Implement jump-till-matching-bracket input function
Part of #1842

It's like jump-to-matching-bracket, but jumps right before the bracket

I will use it to mimic vi 'ab' and 'ib' text objects in the next commit

Given complicated semantics of jump-till-matching-bracket, an alternative name
could be 'jump-inside-matching-brackets'. But that would make names non-symmetrical.
I'm not sure what is worse.
2024-06-30 11:58:10 -07:00
Nikita Bobko
f8ebe346a9
Implement jump-to-matching-bracket motion and bind % (percent) in vi mode
Part of #1842
2024-06-30 11:58:10 -07:00
Nikita Bobko
c966c19c56
Refactoring. Decompose ReaderData.jump function to two functions
Part of #1842

Split to:
- jump_and_remember_last_jump. What previously was called jump, now called
  jump_and_remember_last_jump
- jump. Only jump, don't remember last jump. Now it's also possible to pass
  vector of targets

The commit is pure refactoring, no functional changes are introduced.
The refactoring is needed for the next commits
2024-06-30 11:58:10 -07:00
Peter Ammon
1cbd18cc30
Tweak the allowed clippy set and fix some 2024-06-30 11:38:15 -07:00
Peter Ammon
90535d5b51
Allow clippy::ptr_arg and fix cases 2024-06-29 18:48:49 -07:00
Peter Ammon
cce2aab371
Rename binary_semaphore_t to BinarySemaphore 2024-06-29 18:07:11 -07:00
Peter Ammon
266852327f
Rename fd_readable_set_t to FdReadableSet 2024-06-29 18:06:21 -07:00
Peter Ammon
2d35d3f3c7
Remove yet more dead code 2024-06-29 18:03:52 -07:00
Peter Ammon
6b4dbf3b05
Remove additional dead code 2024-06-29 18:03:52 -07:00
Peter Ammon
1ed256d328
Remove RefCells from ExecutionContext and just make it mut
No more storing these in Parser; big simplification.
2024-06-29 18:03:52 -07:00
Peter Ammon
aa50e4f8c4
Remove some more dead code 2024-06-29 18:03:52 -07:00
Peter Ammon
606b668fff
Remove the pointer module
This is now unused.
2024-06-29 18:03:52 -07:00
Peter Ammon
c212ac95e9
Thread a reference to a line counter into parse execution
Simplify Parser by removing the reference to the execution context
2024-06-29 18:03:52 -07:00
Peter Ammon
b00ab4673b
Adopt the new line counting machinery in parse_execution 2024-06-29 18:03:52 -07:00
Peter Ammon
300fcfdba7
Factor out line counting
This moves the line counting logic from parse_execution into a new type, in
preparation for further refactoring.
2024-06-29 18:03:52 -07:00