about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2010-11-25 17:16:27 +0000
committerWayne Davison <wayned@users.sourceforge.net>2010-11-25 17:16:27 +0000
commitd89e55fe0e78e29808c48e7f12003e765195a21e (patch)
tree8b79e2d1e5e8b5955f7c70308943bd36bdd2dc95 /Src
parent2b361ad11671444831fef3b04bd610c26c2e19e9 (diff)
downloadzsh-d89e55fe0e78e29808c48e7f12003e765195a21e.tar.gz
zsh-d89e55fe0e78e29808c48e7f12003e765195a21e.tar.xz
zsh-d89e55fe0e78e29808c48e7f12003e765195a21e.zip
Overwrite PROMPT_SP string if it should remain invisible,
even with an upcoming newline.
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 2e30c176a..daa753a1f 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1292,9 +1292,10 @@ preprompt(void)
 	countprompt(str, &w, 0, -1);
 	opts[PROMPTPERCENT] = percents;
 	zputs(str, shout);
-	for (w = (int)columns - w - !hasxn; w > 0; w--)
-	    putc(' ', shout);
-	putc('\r', shout);
+	if (hasxn)
+	    fprintf(shout, "%*s\r%*s\r", (int)columns - w, "", w, "");
+	else
+	    fprintf(shout, "%*s\r", (int)columns - w - 1, "");
 	free(str);
     }