From ba58bfe4bfa16e756c8f38cfa0e992ad38b00856 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 8 Feb 2014 14:49:39 -0800 Subject: 32365: another stab at the heuristic for initializing rprompt_indent --- Src/Zle/zle_refresh.c | 2 +- Src/init.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'Src') diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index fd5485770..2bedbc492 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -977,7 +977,7 @@ zrefresh(void) int tmpalloced; /* flag to free tmpline when finished */ int remetafy; /* flag that zle line is metafied */ int txtchange; /* attributes set after prompts */ - int rprompt_off; /* Offset of rprompt from right of screen */ + int rprompt_off = 1; /* Offset of rprompt from right of screen */ struct rparams rpms; #ifdef MULTIBYTE_SUPPORT int width; /* width of wide character */ diff --git a/Src/init.c b/Src/init.c index da2a1bf56..fd12412c7 100644 --- a/Src/init.c +++ b/Src/init.c @@ -77,7 +77,7 @@ mod_export int tclen[TC_COUNT]; /**/ int tclines, tccolumns; /**/ -mod_export int hasam, hasxn, hasye; +mod_export int hasam, hasbw, hasxn, hasye; /* Value of the Co (max_colors) entry: may not be set */ @@ -698,6 +698,7 @@ init_term(void) /* check whether terminal has automargin (wraparound) capability */ hasam = tgetflag("am"); + hasbw = tgetflag("bw"); hasxn = tgetflag("xn"); /* also check for newline wraparound glitch */ hasye = tgetflag("YE"); /* print in last column does carriage return */ @@ -750,7 +751,7 @@ init_term(void) tclen[TCCLEARSCREEN] = 1; } /* This might work, but there may be more to it */ - rprompt_indent = (hasye || !tccan(TCLEFT)) ? 1 : 0; + rprompt_indent = ((hasam && !hasbw) || hasye || !tccan(TCLEFT)); } return 1; } -- cgit 1.4.1