1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-28 15:21:03 +01:00

38229: fix cursor placement calculation when completing in empty double quotes

This commit is contained in:
Barton E. Schaefer 2016-04-05 16:14:55 -07:00
parent 2b7035d974
commit 70fb93b64e
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2016-04-03 Barton E. Schaefer <schaefer@zsh.org>
* 38229: Src/Zle/zle_tricky.c: fix cursor placement calculation
when completing in empty double quotes
2016-03-26 Barton E. Schaefer <schaefer@zsh.org> 2016-03-26 Barton E. Schaefer <schaefer@zsh.org>
* Dmitry Marakasov: 38162: accept G for gigabytes in limit command * Dmitry Marakasov: 38162: accept G for gigabytes in limit command

View file

@ -1849,8 +1849,12 @@ get_comp_string(void)
ocs = zlemetacs; ocs = zlemetacs;
zlemetacs = i; zlemetacs = i;
foredel(skipchars, CUT_RAW); foredel(skipchars, CUT_RAW);
if ((zlemetacs = ocs) > --i) if ((zlemetacs = ocs) > --i) {
zlemetacs -= skipchars; zlemetacs -= skipchars;
/* do not skip past the beginning of the word */
if (wb > zlemetacs)
zlemetacs = wb;
}
we -= skipchars; we -= skipchars;
} }
} else { } else {
@ -1861,6 +1865,9 @@ get_comp_string(void)
zlemetacs = we - skipchars; zlemetacs = we - skipchars;
else else
zlemetacs = ocs; zlemetacs = ocs;
/* do not skip past the beginning of the word */
if (wb > zlemetacs)
zlemetacs = wb;
we -= skipchars; we -= skipchars;
} }
/* we need to get rid of all the quotation bits... */ /* we need to get rid of all the quotation bits... */