1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-08 21:51:15 +02:00
Commit graph

149 commits

Author SHA1 Message Date
Peter Stephenson
c557cee1a6 24581: Fix array assignments in shell word splitting and completion.
Assignments after the first were not recognised as such as without
the full parser the state didn't return to command position.
Fix this in bufferwords() and the completion miniparser.
2019-12-31 18:35:06 +00:00
Oliver Kiddle
50597692e0 43759: add support for true colour terminals 2018-11-05 22:24:12 +01:00
Peter Stephenson
1d6954bd2f 23180: Fix expand-or-complete with ~[...].
The square brackets shouldn't be treated as wildcards.
2018-02-26 21:43:12 +00:00
Peter Stephenson
85b0dd7133 Updates for ksh array element syntax.
Move detection of key/value pairs down into prefork().

Detect normal array assignment and [key]=val array assignemnt
separately.  Mark key / value pairs with Marker and pass up flag.  Deal
with marked triads specially later on.
2017-09-24 17:33:07 +01:00
Barton E. Schaefer
efae75f648 41242: zstrbcmp(...) removed in favor of zstrcmp(..., SORTIT_IGNORING_BACKSLASHES)
This should make sorting consistent in completion listings vs. elsewhere.
2017-06-17 10:25:43 -07:00
Peter Stephenson
32daf2a0aa 40026: Fix for completion after redirection.
This could get confused about where we were in the command
line word array e.g. after the > of "!> .".  Also take more care
if does confused, with debug output. Also neaten up one
obscure test.
2016-11-29 17:08:56 +00:00
Peter Stephenson
99f74d6c0a unposted: Update findcmd() in Zle.
Unfinished business from previous patch.
2016-09-29 14:19:17 +01:00
Daniel Shahaf
f368720b8b 39252: internal: quotestring: Drop the 'e' parameter, which no caller uses. 2016-09-11 09:22:18 +00:00
Barton E. Schaefer
b911398064 38248: fix word position calculation when completing on or just before a redirection operator
The completion result is still in need of some repair; e.g., if the first
thing on the line is the redirection, completion before it is not taken
to be in command position, and in this and other cases a necessary space
is not inserted between the completed word and the redirection.
2016-04-07 20:24:43 -07:00
Barton E. Schaefer
70fb93b64e 38229: fix cursor placement calculation when completing in empty double quotes 2016-04-05 16:14:55 -07:00
Oliver Kiddle
8c29b34032 38043: allow any completion widget to cycle matches for menu completion to fix reverse menu completion 2016-03-07 13:15:40 +01:00
Daniel Shahaf
9ab9da49f7 unposted: Make $EDITOR's jump-to-matching-brace happy. 2015-11-13 20:18:25 +00:00
Peter Stephenson
830d54e629 37092: make nested ${(P)name} properly refer to parameter on return 2015-11-11 18:04:20 +00:00
Daniel Shahaf
8165b488cb unposted: zle: Document the C helper function processcmd().
Also, tweak the docstring of zlelineasstring().
2015-09-25 23:38:41 +00:00
Peter Stephenson
21382e0b20 36365: magic-space could delete the reset of the line.
If we got a LEXERR, which didn't necessarily mean an actual error,
just something the rather nasty ctxtlex() got confused by, we
didn't scan the reset of the line.
2015-09-01 11:45:23 +01:00
Barton E. Schaefer
85645fd683 36288: refine 36825, slightly different test for redirect context 2015-08-26 22:16:12 -07:00
Barton E. Schaefer
8186e9c94b 36285: update 36025, context cannot be command and redirect at the same time, redirect wins 2015-08-26 21:50:13 -07:00
Peter Stephenson
249999cfb4 36025: Fix completion aftoer "foo=bar; setopt ".
Done by catching a case that doesn't seem to be handled otherwise,
so there's some hope it doesn't screw up too much.
2015-08-09 18:40:54 +01:00
Peter Stephenson
771381c2ce 35908: fix $((...)) completion in expand-or-complete widget 2015-07-25 20:22:23 +01:00
Oliver Kiddle
6e57de8ee2 35637: remove the now unused module hook for reverse-menu-complete 2015-06-29 01:59:43 +02:00
Oliver Kiddle
44c56f3af5 35627: make reverse-menu-complete start with the last match in
menu selection
2015-06-29 01:54:44 +02:00
Peter Stephenson
77a0278bcc 35615: fix completion after tyepset 2015-06-26 17:56:44 +01:00
Peter Stephenson
cfd91eac07 Rearrange context saving.
Variables are now associated with the module that declares them, being
initialised and saved/restored there.  However, as many variables are
used for communication between modules, many of them are set in multiple
places, so the assignment is ambiguous.
2015-01-09 21:33:39 +00:00
Jun-ichi Takimoto
152b797596 34144: allocate origline by ztrdup(), not by dupstring()
If origline is allocated in heap, it will have been freed
when menuselect() is called directly as a widget.
2015-01-07 21:48:28 +09:00
Peter Stephenson
d067ebcacd 33876: etc.: Separate errors and keyboards interrupts
Combination of 12 commits from interrupt_abort branch.

Basic strategy is to introduce bits to errflag and to set and
reset them separately.

Remove interrupt status on return to main keymap.

Turn off ERRFLAG_INT for always block.

Restore bit thereafter: we probably need a new variable in order
to allow user interrupts to be reset in the always block.

Add TRY_BLOCK_INTERRUPT

This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too.

Ensure propagation of SIGINT from exited job.

If received by foreground job, shell uses ERRFLAG_INT, not
ERRFLAG_ERROR, to set the new state.

Reset errflag before precmd()

Add always block in _main_completion to fix ZLS_COLORS

Ensures we get the right state of $ZLS_COLORS at the end of _main_complete
even if there's an interrupt.  However, the "right state" is a bit messy
as it depends on styles.
2014-12-11 09:41:17 +00:00
Peter Stephenson
11c3bc3d73 33480, slightly tweaked: fix for $' completion.
Improves case where completing after the $' but before any
closing quote, or if the closing quote is absent.
No other change --- we still don't attempt to exand the quotes if
we're inside them.
2014-10-24 09:54:55 +01:00
Barton E. Schaefer
31e2ae380a 32540: in doexpandhist(), discard saved line position data rather than restoring from it (updates 32531). 2014-04-13 01:26:07 -07:00
Barton E. Schaefer
f61037a0b0 32531: fix memory leaks detected by valgrind 2014-04-06 09:55:49 -07:00
Oliver Kiddle
90916c4e08 32361: don't reset lastline before completion 2014-02-14 22:51:33 +01:00
Barton E. Schaefer
620b915c4e Fix leading whitespace in a comment 2014-02-02 13:37:36 -08:00
Oliver Kiddle
a8c4ed64ee 32314: merge undo events corresponding to vi change in the vi-cmd-mode widget so undo from insert mode is useful again 2014-01-31 14:03:47 +01:00
Barton E. Schaefer
1136b9b296 32182: re-enable command completion after a separator 2013-12-25 16:24:27 -08:00
Patrick Oscity
977f9ff5c8 32114: ZLE_PROMPT_INDENT allows you to move rprompt flush right 2013-12-16 21:35:21 +00:00
Peter Stephenson
8ae8fae400 31644: Fix insertion of multibyte characters into editor line.
This was broken for a string that came from outside ZLE in the case
where the editing buffer wasn't metafied, i.e. not in completion.
2013-08-08 20:10:06 +01:00
Peter Stephenson
568e0db7a9 31611: attempt to fix crash completing redirection in do loop 2013-08-02 18:58:35 +01:00
Peter Stephenson
eb562c9f2c 30715: use enum lextok for variables containing lexical tokens 2012-10-05 21:35:05 +00:00
Peter Stephenson
8dc39360c9 29820: _pick_variant -b to match builtin 2011-10-14 19:01:41 +00:00
Peter Stephenson
4a3ce8ab89 29644: work around _describe bug, plus cosmetic tweaks 2011-08-03 20:57:32 +00:00
Peter Stephenson
e1680e6840 29503: Missing popheap() on failed autoload 2011-06-23 19:29:24 +00:00
Peter Stephenson
437d5d98f6 unposted: Remove additional for loop noticed by Mikael 2011-06-19 19:42:41 +00:00
Peter Stephenson
962624e8c3 29491: remove some variables set but not used 2011-06-19 16:26:10 +00:00
Peter Stephenson
d89361739a 29165: use term.h globally if needed at all. 2011-05-09 09:49:08 +00:00
Bart Schaefer
2938c58c82 29107: replace overlapping strcpy with memmove 2011-04-29 15:23:33 +00:00
Bart Schaefer
67847a96ee 28926: No newline after the last line in listlist() when printing the list
in a single column.
2011-03-28 04:50:20 +00:00
Peter Stephenson
212ca9edf9 28772: Update regions in region highlight dynamically 2011-02-18 22:08:45 +00:00
Peter Stephenson
ebcead7543 lexsave/lexrestore lexflags
add new LEXFLAGS_ZLE
2010-12-14 10:35:38 +00:00
Peter Stephenson
eab4f9a83c 28528: Rearrange zleparse to lexflags
Add (z+n+)
2010-12-14 09:59:04 +00:00
Peter Stephenson
08dec290d4 Fix ZLE access to pushed history line 2010-03-22 16:22:13 +00:00
Peter Stephenson
7293565963 27479: prevent completions split across backslash-newline
from causing too much mayhem
2009-12-07 21:40:04 +00:00
Peter Stephenson
2237f7376e users/14307: end of command line in completion with variant zsh syntax 2009-08-15 16:59:21 +00:00