Daniel Shahaf
a23f19bfbd
48601/0005: zmathfuncdef: Fix the workers/48147 return status / 'set -e' bug.
...
Not tested.
2021-05-18 02:01:13 +00:00
Marlon Richert
7383baf4cf
48853: improved handling of theme resets when changing prompt themes, especially for theme preview
2021-05-16 21:18:06 -07:00
Bart Schaefer
acd20254b5
48710: histed + other zed updates
2021-05-15 13:37:35 -07:00
Bart Schaefer
231c049c02
48707: fix keymap handling when zed invokes read-from-minibuffer; update doc
2021-05-15 13:23:31 -07:00
Daniel Shahaf
b0bd14035d
48606 + 48607 + unposted test: zmathfunc: Force arguments to be numbers and catch errors.
2021-04-21 22:05:00 +00:00
Daniel Shahaf
9353b12e99
users/26635 (tweaked): vcs_info hg: Compute the branch name correctly when get-revision is set and check-for-changes is not
...
Tweak: Simplify an always-true condition.
Review-by: Manuel Jacob
2021-04-21 00:57:59 +00:00
Bart Schaefer
5fdd98552d
47489: rename standout as italic
2021-04-19 14:37:32 -07:00
Aleksandr Mezin
fc82e8193b
47561 (the git and cvs parts) (compare 44919 + 44920): vcs_info internals: cvs, git: Set ${vcs_comm[basedir]} like all other backends do.
...
That doesn't affect anything, not even other vcs_info internals; it's
just for consistency across backends.
2021-03-29 17:03:40 +00:00
Daniel Shahaf
f87b73e677
48147/0002: zmathfunc: Fix bug where the exit code would be non-zero if the expression evaluted to zero.
2021-03-07 21:58:13 +00:00
Arseny Maslennikov
8b67c36d92
48094: apply cleanup commands of the current theme on any theme change
...
* Rename zstyle `cleanup' on the context `:prompt-theme' to `restore'
everywhere but in prompt_cleanup(). It is only used as a restore
mechanism now.
* Ensure prompt_cleanup() continues to store its command list in the
`cleanup' style.
* Clean up before theme switch at the end of set_prompt().
* Prepend every use of prompt_*_setup (which might modify the shell
state in ways that require cleanup) with a cleanup run.
* Adjust `prompt restore' to do both parts of the newly split restore
mechanism, cleanup first.
2021-02-22 20:29:55 -08:00
Arseny Maslennikov
5c60ec46ec
47867: Fix RPROMPT typo in prompinit
2021-02-19 18:39:22 -06:00
Peter Stephenson
8f42ecd8ee
47873: Improve completion within dynamic directory names
2021-01-27 11:16:55 +00:00
Bart Schaefer
b374f7b318
users/26406: preserve caller setopts in zargs
2021-01-23 13:25:24 -08:00
Jun-ichi Takimoto
34eae73490
47731 (+unposted): add run-help assistant for btrfs
...
also fix format errors in contrib.yo
2020-12-11 17:27:47 +09:00
Samir Benmendil
f493b438fd
43946: call run-help for the command given to sudo
2020-12-11 17:20:45 +09:00
Mikael Magnusson
0bc559d091
47307: edit-command-line: restrict editing to region if it is active
2020-08-16 18:04:43 +02:00
Mikael Magnusson
841188439b
47306: edit-command-line: add editor style
2020-08-16 18:04:43 +02:00
Mikael Magnusson
d877073959
47305: edit-command-line: when possible, set $BUFFER directly
...
This avoids the send-break which is both visually unappealing and might
break some use cases where the user wishes to wrap edit-command-line in
another widget.
2020-08-16 18:04:43 +02:00
Daniel Shahaf
5448e1611d
47303: vcs_info hg: Fix changing the expansion of %g (hook_com[guards]) in the set-patch-format hook (regression from workers/40480).
...
To reproduce, go to a hg repository with active mq guards and configure
vcs_info as follows:
zstyle '*' get-unapplied true
zstyle ':vcs_info:*set-patch-format*' hooks f
zstyle '*' patch-format '[%g : %G]'
zstyle '*' nopatch-format '[%g : %G]'
zstyle '*' formats '%m'
+vi-f () {
hook_com[guards]+=XXX
}
The regression was first released in 5.3.1-test-2, over three years ago.
2020-08-09 08:07:01 +00:00
Daniel Shahaf
0cffb0a6b3
46072 + 46136: Add the 'zle $widget -f nolast' syntax, to improve add-zle-hook-widget support for multiple hook functions.
...
See workers/46004 for the use-case.
2020-06-27 03:09:31 +00:00
Manuel Jacob
ae0129b49f
46091: Add code to Mercurial VCS backend to show topic if there is any.
...
"Topics" is an experimental concept in Mercurial that augments the
current branching concept (called "named branches").
For more information, see the not always up-to-date Mercurial Wiki page
https://www.mercurial-scm.org/wiki/TopicPlan .
2020-06-22 08:18:38 +00:00
Daniel Shahaf
2f2aa360bc
45644: vcs_info git: Fix current patch's name in several cases.
2020-03-28 22:12:33 +00:00
Daniel Shahaf
d13d6afb2e
45627: vcs_info git: Under git-am(1) conflicts, pass to the gen-applied-string hook information on already-applied patches.
...
The hook already receives information about the current (topmost
applied) patch and, if the get-unapplied style is set, about future
(unapplied) patches.
Tested in the Functions/VCS_Info/test-repo-git-rebase-apply scenario,
after manually converting the rebase to a «git am». (Specifically,
I ran:
mkdir d
git rebase --abort
git format-patch rebase_from_this..HEAD -o d
git checkout rebase_onto_this
git am d/*
.)
2020-03-27 01:14:42 +00:00
Daniel Shahaf
f207fb90d8
45625: vcs_info svn: Detect the "working copy format is too new" error.
2020-03-27 01:14:42 +00:00
Daniel Shahaf
cb87816b0f
45626: vcs_info: Deduplicate calling the set-branch-format hook.
2020-03-27 01:14:42 +00:00
Daniel Shahaf
b0d020408a
45624: vcs_info: Set $rrn in all backends.
2020-03-27 01:14:42 +00:00
Daniel Shahaf
e5765bfdc8
45541: internal: vcs_info git: Add a test case repository for rebase-apply situations
2020-03-15 00:18:31 +00:00
Daniel Shahaf
4ce4483daf
45539: vcs_info git: In non-interactive rebases, obtain applied patches' names.
2020-03-15 00:18:30 +00:00
Daniel Shahaf
e1946bacf8
45540: vcs_info git: In non-interactive rebases, compute patch names for unapplied patches.
2020-03-15 00:18:28 +00:00
Daniel Shahaf
5a1f5cf8ab
45543: vcs_info quilt: Allow quiltcommand to be a function.
...
Before this commit, it could only be an external command.
2020-03-15 00:18:27 +00:00
Daniel Shahaf
8e128afb2c
45547: vcs_info git: In interactive rebases, process gen-unapplied-string arguments like gen-applied-string arguments are processed.
...
I consider this a bugfix, since it's unexpected for -applied and
-unapplied to differ about this.
2020-03-15 00:18:25 +00:00
Daniel Shahaf
c756545014
45546: vcs_info git: In interactive rebases, properly support the full form of the "exec" verb.
...
The code before this commit happened to have done the right thing:
"exec" lines were handled by the catchall forward compatibility case,
which happened to have had virtually the same effect as the correct
case. However, that was merely an accidental result. This patch makes
the code do the right thing deliberately, rather than by accident.
2020-03-15 00:18:23 +00:00
Daniel Shahaf
af57462beb
45545: vcs_info git: In interactive rebases, ignore comment lines.
2020-03-15 00:18:21 +00:00
brian m. carlson
5126096370
github #48/0002: vcs_info git: properly detect bare repositories
...
We currently detect Git repositories by finding the top level of the
working tree, and if we fail to detect it, assume that we're not in a
repository. However, there's a case we don't consider: a bare
repository.
Let's detect if the user is in a bare repository by checking if gitdir
is set, and if so, using that if there is no working tree. We now
detect bare Git repositories with vcs_info, as expected.
2020-02-17 10:03:08 +00:00
brian m. carlson
bacad96523
github #48/0001: vcs_info git: avoid warnings in bare repositories
...
Git 2.25 introduced a change to how git rev-parse --show-toplevel
behaves. Traditionally, it succeeded with no output if the user was
in a bare repository. Now it dies, printing an error to standard error.
Consequently, when the user is in a bare repository with a newer Git,
vcs_info prints noisily to standard error.
While this is functionally harmless, it is annoying for the shell to
print messages from Git every time the prompt is printed, so let's
silence the error message.
2020-02-17 10:02:27 +00:00
Jens Schleusener
11dbe4c286
45269: Fix misspellings in completions and elsewhere.
2020-01-09 13:42:02 +00:00
Andrey Butirsky
41e35f24f7
45239: Remove 'appendhistory' from zsh-newuser-install
...
It is on by default, and new users are unlikely to want to change it.
2020-01-05 17:50:33 +00:00
Daniel Shahaf
86db36ab70
45114: vcs_info quilt: Improve support for svn-style patch headers.
...
Additional lines between the |-separated header line and the actual
log message, as generated by 'svn log -v' and 'svn log -g', are now
supported.
This change affects you if you have quilt patches with 'svn log'-style
information in their headers, regardless of whether you use quilt
standalone, quilt over svn, or quilt over some other VCS.
2019-12-22 03:21:03 +00:00
Martijn Dekker
d81238ee95
45003: Fix more documentation typos
2019-12-11 02:37:39 +00:00
Daniel Shahaf
61262ae282
44960: vcs_info cvs: Fix infinite loop when /CVS exists.
2019-12-03 03:03:05 +00:00
Daniel Shahaf
9e771a0b20
44961: vcs_info svn: Fix infinite loop when /.svn exists.
2019-12-03 02:56:02 +00:00
Daniel Shahaf
ce950dd4b4
44962: vcs_info: Document internal function and variable
2019-12-03 02:56:01 +00:00
Daniel Shahaf
98f8a8a980
44958: vcs_info quilt: Avoid forks
2019-11-29 20:57:01 +00:00
Daniel Shahaf
cc3983ee58
44945: vcs_info git: Optimize detection by running fewer external commands.
2019-11-29 20:56:42 +00:00
Bart Schaefer
530d6337e6
unposted (see 44772): quote the string argument to zle -U
2019-09-24 10:07:32 -07:00
Peter Stephenson
09385d38ad
44305: Fix zsh_directory_name_generic
...
Longest prefix matching was broken if there were suffixes indicating
further handling.
2019-07-10 15:41:24 +01:00
Bart Schaefer
cf66eb7adb
43755: Fix state management for repeat uses to avoid clobbering command line when NOT a repeat
2019-07-08 18:01:38 -07:00
dana
b70919e0d9
44020: VCS_INFO_detect_p4: Fix infinite recursion
2019-01-27 00:26:31 -06:00
Peter Stephenson
b6169745c1
unposted, c.f. 43913: emulate -L zsh in edit-command-line
...
Otherwise bad effects observed with GLOB_SUBST set.
2018-12-19 09:54:26 +00:00
Daniel Shahaf
23154e46e6
43879: vcs_info git: Fix fatal error in VCS_INFO_git_getbranch in corner case
...
Before this commit, the following use-case:
git checkout foo^
git show foo | git am
would result in a fatal error, with vcs_info_msg_N_ not set:
VCS_INFO_git_getbranch:18: no such file or directory: .git/rebase-apply/onto
Now they are set correctly, and HEAD's commit hash is used.
2018-12-13 15:28:00 +00:00
Joey Pabalinas
fc3826190a
43779 (tweaked): add parentheses to fix expression with cprecedences option set
2018-11-08 11:46:27 +01:00
Daniel Shahaf
f6adb79ba5
43685: add-zle-hook-widget: Support running under NO_UNSET ('set -u').
2018-10-14 14:01:33 +00:00
Daniel Shahaf
e38f15f8ff
43620 (tweaked): vcs_info git: Reverse the order patches are passed to gen-unapplied-string in.
...
This is an incompatible change; see README for details.
Tweaks (relative to posted version): tweaked README, removed scalpel (debug print).
2018-10-08 13:44:40 +00:00
Daniel Shahaf
31dcba76f0
43617: vcs_info git: During a non-interactive rebase of a detached head, computer the %b expando correctly.
...
Before this commit, the value of %b was the hash of the commit from the
"source" side of the rebase, from .git/rebase-apply/orig-head and
.git/rebase-apply/original-commit. This broke the invariant that
%b expands to a git-rev-parse(1) expression resolving to what %r
expands to.
Use .git/rebase-apply/onto instead as, empirically, it contains the
correct value.
2018-10-08 13:41:45 +00:00
Daniel Shahaf
0e0219118d
43619: vcs_info git: In non-interactive rebases, always set $hook_com[git_patches_applied] to a string of the form 'foo bar', never just 'foo'.
2018-10-08 13:41:43 +00:00
Daniel Shahaf
a05533e425
43618: vcs_info: Don't redefine helper functions on every execution of the autoloadable outer function.
...
This allows enabling tracing of the helper functions without fned'ing
the outer function.
2018-10-08 13:41:41 +00:00
Daniel Shahaf
5c9ef1a1fa
43587: vcs_info git: In 'git rebase -i', when computing subjects of applied-patches, handle an edge case where the subject is not available.
2018-10-07 15:05:19 +00:00
Daniel Shahaf
0c00eed4c7
43588: vcs_info git: Make sure applied-patches is of the form "$hash $subject" --- that is, has a space and a non-empty second argument --- even with future 'git rebase -i' verbs.
...
Use of '?' is consistent with these precedents:
Backends/VCS_INFO_get_data_git:220: printf -v "git_patches_applied[$p]" "%04d ?" "$p"
Backends/VCS_INFO_get_data_git:242: git_patches_applied+=("? $subject")
Backends/VCS_INFO_get_data_git:244: git_patches_applied+=("?")
VCS_INFO_quilt:160: applied[$i]+=" ?"
VCS_INFO_quilt:168: unapplied[$i]+=" ?"
2018-10-07 15:05:17 +00:00
Daniel Shahaf
a27fad1ae2
43586: vcs_info git: Reformat to minimise next diff. No functional change.
2018-10-07 15:05:15 +00:00
Daniel Shahaf
abc94e8f6a
43585: vcs_info svn: Recognize working copies in need of an upgrade.
2018-10-07 15:05:13 +00:00
Daniel Shahaf
f9952301b2
unposted: Indicate which use-case each branch handles.
2018-10-02 15:22:06 +00:00
Daniel Shahaf
40d9681b62
43313 (log message tweaked): vcs_info git: For the branch name, try to find a symbolic name before falling back to a raw commit hash.
...
Ask git-describe(1) and git-name-rev(1) to compute a gitrevisions(7)
name in terms of a branch or tag that contains (= is a descendant of,
is younger than) HEAD.
In this repository, the output changes from "9567bfe..." to
"master~1" or "remotes/origin/HEAD~1". This would also happen
during bisects, e.g., "bisect/bad~22".
2018-08-24 15:50:18 +00:00
Daniel Shahaf
4cfbbf9ca5
43314: vcs_info git: Flatten a nested if.
...
No functional change.
2018-08-24 15:49:38 +00:00
Peter Stephenson
0a6cb5078d
43084: Variable warning suppression enhancements.
...
Add vared -g option along the lines of typeset -g.
Set reply safely in zsh_directory_name_cdr.
2018-06-25 09:31:40 +01:00
dana
faa07d064b
43030: Replace VCS_INFO_realpath() by :P
2018-06-16 12:03:23 -05:00
Oliver Kiddle
594f2ff06e
users/23434: initialise UNDO_LIMIT_NO so that an initial undo doesn't clear the whole edit buffer
2018-06-07 17:48:48 +02:00
Sebastian Gniazdowski
52f1c4ffb0
42929 (tweaked): additional default bindings in zed.
...
Add to both zed and zed-vicmd keymaps.
2018-06-05 09:38:31 +01:00
Sebastian Gniazdowski
abd0040253
41839: force IFS to default for "read"
2018-01-19 22:56:11 -08:00
Daniel Shahaf
a8ad9768bd
unposted: vcs_info: Add docstrings to the internal functions VCS_INFO_formats and VCS_INFO_set.
2017-12-30 06:14:22 +00:00
Alexey Sokolov
1a5d8a6916
41952: Use HGPLAIN instead of HGRCPATH in VCS_INFO_get_data_hg
...
Fixes prompt indicator in case if the repository requires a non-default
feature. With HGRCPATH, it results in:
abort: repository requires features unknown to this Mercurial: ...
(see https://mercurial-scm.org/wiki/MissingRequirement for more information)
Which, in turn, results in "default" getting reported regardless of what
is the current state of the repo.
2017-10-25 10:34:34 +02:00
Barton E. Schaefer
96845524a6
41899: handle multi-word values of $VISUAL et al., and line counting of buffer for emacs startup
2017-10-15 11:17:06 -07:00
Peter Stephenson
b2e44bce62
Make mbegin, mend, match local in zed.
...
Needed for zstyle -m.
2017-08-31 16:55:26 +01:00
Daniel Shahaf
d6aa949977
41565: vcs_info patch2subject: Support svn log -r N --diff
output.
2017-08-22 20:50:14 +00:00
Barton E. Schaefer
43e55a9bcd
41472: introduce cleanup hooks default and restore special themes, and update documentation
2017-07-29 16:58:39 -07:00
Peter Stephenson
d78761c003
41345: Use consistent prompt variables in prompt themese.
...
Some more sanity may be needed in this area but this apsect seems
uncontroversial.
2017-06-26 11:16:38 +01:00
Wieland Hoffmann
cf72c2d288
41265: quote the inserted file names as necessary
2017-06-16 22:28:54 -07:00
Eric Cook
6ecc34a55e
unposted: fix typo in url-quote-magic
2017-06-13 21:47:48 -04:00
Sebastian Gniazdowski
d6d7ef2a0d
41232: Use page up/down keys in zed keymap.
...
Find with terminfo where available.
2017-06-07 10:01:38 +01:00
Peter Stephenson
ab6f30350a
unposted: Use typeset -g in insert-unicode-char
...
Avoid warning from WARN_NESTED_VAR if set.
2017-05-02 09:39:53 +01:00
Aaron Schrab
7fc15db684
40892: subcommand matching for ip help
2017-03-24 09:46:03 +00:00
Barton E. Schaefer
1b0541c52f
Julien Nicoulaud: 40586: discard stderr
2017-02-21 20:45:18 -08:00
Daniel Shahaf
ecd88284f3
40492: vcs_info: Escape '%' signs in payloads.
...
Test case: a patch whose subject is '%Sfoo%sbar'. ('S' and 's' are
expandos both in prompts and in the 'formats' style.)
2017-02-09 15:24:04 +00:00
Daniel Shahaf
bb6c08b51a
unposted: vcs_info git: Fix typo in manual.
2017-02-04 05:55:46 +00:00
Daniel Shahaf
33c0a10448
40480: vcs_info set-patch-format: Eliminate the remaining code duplication.
2017-02-03 18:14:01 +00:00
Daniel Shahaf
9211d7f277
40479: vcs_info set-patch-format: Prepare for more code sharing between the callers.
...
This changes hook invocation order in the hg backend.
2017-02-03 18:14:00 +00:00
Daniel Shahaf
fca4f90bba
40481: vcs_info hg: Pass arguments to the set-patch-format hook.
2017-02-03 18:13:59 +00:00
Daniel Shahaf
3a1756b728
40478: vcs_info set-patch-format: Guard against empty variable elision.
2017-02-03 18:13:58 +00:00
Daniel Shahaf
49bc46946e
40476: vcs_info $backend_misc: Document at the right point, provide in quilt 'standalone' mode.
2017-02-03 18:13:57 +00:00
Daniel Shahaf
2854a67e09
40403/0004: vcs_info set-patch-format helper: Part #4 .
...
This also fixes the %a (${hook_com[all-n]}) expando in the hg backend:
before this change, it counted only unapplied changes.
2017-01-25 04:22:32 +00:00
Daniel Shahaf
edd9798de7
40403/0003: vcs_info set-patch-format helper: Part #3 .
2017-01-25 04:22:32 +00:00
Daniel Shahaf
2702857334
40403/0002: vcs_info set-patch-format helper: Part #2 .
...
Not all callers reset ${hook_com}, but those that don't, immediately
overwrite it a few lines later.
2017-01-25 04:22:31 +00:00
Daniel Shahaf
0ea1957608
40403/0001: vcs_info set-patch-format helper: Part #1 .
2017-01-25 04:22:30 +00:00
Daniel Shahaf
57013f8b96
40401: vcs_info git: Fix the %c patch-format expando.
...
Before this change, ${git_unapplied_s} was unused and the %c
(${hook_com[unapplied]}) expando evaluated to the number of digits in
the string returned by the gen-unapplied-string hook (or to the number
of digits in the number of unapplied patches, when there was no such
hook).
2017-01-25 04:22:30 +00:00
Daniel Shahaf
699a38e698
40392: vcs_info patch2subject: Support git show
output.
2017-01-25 04:22:28 +00:00
Barton E. Schaefer
5455798bb5
Oliver: 40118: alternate fix replacing 40115
...
This commit reverts 40115 (commit 3594f55f
) thus restoring 38579, then
applies 40118: Relocate BUFFER/CURSOR reset to work around "fc -p" issue
2016-12-24 00:15:21 -08:00
Daniel Shahaf
816084c0ac
40149: vcs_info git: Avoid a fork.
2016-12-16 10:48:10 +00:00
Daniel Shahaf
feb4be4a5e
40126: zed (fned): When editing a new function. escape its name.
...
Example:
% unfunction \(
% fned \(
2016-12-09 08:21:07 +00:00
Zhiming Wang
3594f55fc0
40115: revert 38579 due to bug restoring BUFFER after history search
...
This reverts commit 20948d0889
.
2016-12-06 21:37:30 -08:00
Daniel Shahaf
f71de84f1d
unposted: vcs_info git: Handle rebase-apply sequences with >=10000 patches.
...
Review-by: Frank Terbeck
2016-12-04 21:37:02 +00:00
Daniel Shahaf
d9237ccdbf
40074: vcs_info git: rfc822-unfold rebase-apply patch subjects when msg-clean is unavailable.
...
Example (in this repository):
git -c merge.merge-changelog.driver=/bin/false rebase --onto=1955cce^^ 1955cce^ 1955cce
2016-12-04 21:37:01 +00:00