diff options
| author | Barton E. Schaefer <schaefer@zsh.org> | 2016-04-07 20:24:43 -0700 |
|---|---|---|
| committer | Barton E. Schaefer <schaefer@zsh.org> | 2016-04-07 20:24:43 -0700 |
| commit | b9113980642f37d780d646fcbf4ef90dca69ae3f (patch) | |
| tree | a9f950dfeb33f03a66d978c2fe20dcd47c082263 /Src/lex.c | |
| parent | 38229: fix cursor placement calculation when completing in empty double quotes (diff) | |
| download | zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.tar zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.tar.gz zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.tar.bz2 zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.tar.lz zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.tar.xz zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.tar.zst zsh-b9113980642f37d780d646fcbf4ef90dca69ae3f.zip | |
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.
Diffstat (limited to 'Src/lex.c')
| -rw-r--r-- | Src/lex.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1789,9 +1789,13 @@ parse_subst_string(char *s) static void gotword(void) { - we = zlemetall + 1 - inbufct + (addedx == 2 ? 1 : 0); - if (zlemetacs <= we) { - wb = zlemetall - wordbeg + addedx; + int nwe = zlemetall + 1 - inbufct + (addedx == 2 ? 1 : 0); + if (zlemetacs <= nwe) { + int nwb = zlemetall - wordbeg + addedx; + if (zlemetacs >= nwb) { + wb = nwb; + we = nwe; + } lexflags = 0; } } |
