summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-19 17:32:08 +0200
committerPeter Stephenson <p.stephenson@samsung.com>2019-05-28 09:39:22 +0100
commit3eea35d0853bddae13fa6f122669935a01618bf9 (patch)
tree8075f22a675a34da4df5e5a04dc040efecd05553
parent06f5964284216bb4ebdc30c9fe77bdc1043add03 (diff)
downloadzsh-3eea35d0853bddae13fa6f122669935a01618bf9.tar.gz
zsh-3eea35d0853bddae13fa6f122669935a01618bf9.zip
fix cursor position with ZLE_RPROMPT_INDENT=0
-rw-r--r--Src/Zle/zle_refresh.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 1f293845f..85e55e0d4 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1678,7 +1678,12 @@ zrefresh(void)
moveto(0, winw - rprompt_off - rpromptw);
zputs(rpromptbuf, shout);
- vcs = winw - rprompt_off;
+ if (rprompt_off) {
+ vcs = winw - rprompt_off;
+ } else {
+ zputc(&zr_cr);
+ vcs = 0;
+ }
/* reset character attributes to that set by the main prompt */
txtchange = pmpt_attr;
/*
@@ -2159,25 +2164,20 @@ moveto(int ln, int cl)
const REFRESH_ELEMENT *rep;
if (vcs == winw) {
- if (rprompt_indent == 0 && tccan(TCLEFT)) {
- tc_leftcurs(1);
- vcs--;
- } else {
- vln++, vcs = 0;
- if (!hasam) {
- zputc(&zr_cr);
- zputc(&zr_nl);
- } else {
- if ((vln < nlnct) && nbuf[vln] && nbuf[vln]->chr)
- rep = nbuf[vln];
- else
- rep = &zr_sp;
- zputc(rep);
- zputc(&zr_cr);
- if ((vln < olnct) && obuf[vln] && obuf[vln]->chr)
- *obuf[vln] = *rep;
- }
- }
+ vln++, vcs = 0;
+ if (!hasam) {
+ zputc(&zr_cr);
+ zputc(&zr_nl);
+ } else {
+ if ((vln < nlnct) && nbuf[vln] && nbuf[vln]->chr)
+ rep = nbuf[vln];
+ else
+ rep = &zr_sp;
+ zputc(rep);
+ zputc(&zr_cr);
+ if ((vln < olnct) && obuf[vln] && obuf[vln]->chr)
+ *obuf[vln] = *rep;
+ }
}
if (ln == vln && cl == vcs)