From 70fb93b64ef68457f5ca2bb6b68cf2e59ec7287c Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Tue, 5 Apr 2016 16:14:55 -0700 Subject: 38229: fix cursor placement calculation when completing in empty double quotes --- Src/Zle/zle_tricky.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index a89b2a376..b1709c117 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1849,8 +1849,12 @@ get_comp_string(void) ocs = zlemetacs; zlemetacs = i; foredel(skipchars, CUT_RAW); - if ((zlemetacs = ocs) > --i) + if ((zlemetacs = ocs) > --i) { zlemetacs -= skipchars; + /* do not skip past the beginning of the word */ + if (wb > zlemetacs) + zlemetacs = wb; + } we -= skipchars; } } else { @@ -1861,6 +1865,9 @@ get_comp_string(void) zlemetacs = we - skipchars; else zlemetacs = ocs; + /* do not skip past the beginning of the word */ + if (wb > zlemetacs) + zlemetacs = wb; we -= skipchars; } /* we need to get rid of all the quotation bits... */ -- cgit 1.4.1