about summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
authorPatrick Oscity <patrick.oscity@gmail.com>2013-12-15 12:01:21 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-12-16 21:35:21 +0000
commit977f9ff5c8137b76fea8e93498086525af460cc5 (patch)
treee1ab695a531323b0855190b88203396a71a4518d /Src/Zle/zle_tricky.c
parent71038e31db8076ff2229a5b4629536044b2367d1 (diff)
downloadzsh-977f9ff5c8137b76fea8e93498086525af460cc5.tar.gz
zsh-977f9ff5c8137b76fea8e93498086525af460cc5.tar.xz
zsh-977f9ff5c8137b76fea8e93498086525af460cc5.zip
32114: ZLE_PROMPT_INDENT allows you to move rprompt flush right
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index e30e0b1aa..25f09c459 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -1504,7 +1504,17 @@ get_comp_string(void)
 	    nnb = s + MB_METACHARLEN(s);
 	else
 	    nnb = s;
-	for (tt = s; tt < s + zlemetacs_qsub - wb;) {
+	tt = s;
+	if (lincmd)
+	{
+	    /*
+	     * Ignore '['s at the start of a command as they're not
+	     * matched by closing brackets.
+	     */
+	    while (*tt == Inbrack && tt < s + zlemetacs_qsub - wb)
+		tt++;
+	}
+	while (tt < s + zlemetacs_qsub - wb) {
 	    if (*tt == Inbrack) {
 		i++;
 		nb = nnb;