summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-04-05 16:14:55 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-04-05 16:14:55 -0700
commit70fb93b64ef68457f5ca2bb6b68cf2e59ec7287c (patch)
treeede5a70b200d14db9efac9c393636171a7e722ac /Src/Zle
parent2b7035d974a69d9a47b1f89f868787a4585386a1 (diff)
downloadzsh-70fb93b64ef68457f5ca2bb6b68cf2e59ec7287c.tar.gz
zsh-70fb93b64ef68457f5ca2bb6b68cf2e59ec7287c.tar.xz
zsh-70fb93b64ef68457f5ca2bb6b68cf2e59ec7287c.zip
38229: fix cursor placement calculation when completing in empty double quotes
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_tricky.c9
1 files changed, 8 insertions, 1 deletions
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... */