[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] rl_redisplay: don't adjust cursor position twice for meta chars
From: |
Grisha Levit |
Subject: |
[PATCH] rl_redisplay: don't adjust cursor position twice for meta chars |
Date: |
Tue, 18 Apr 2023 02:05:07 -0400 |
The code for displaying characters with octal escapes seems to
increment the cursor position twice for each character in the escape
sequence.
printf -v s '%*s' "$((COLUMNS/5))"
PS1= LC_ALL=C bash --norc -in <<<${s// /$' \200'}
\200 \200 \200 \200 \200 \200 \200 \200 \20
0 \200 \200 \200 \200 \200 \200
----
diff --git a/lib/readline/display.c b/lib/readline/display.c
index fb10c60a..fb5477a0 100644
--- a/lib/readline/display.c
+++ b/lib/readline/display.c
@@ -1125,20 +1125,6 @@ rl_redisplay (void)
int olen;
olen = sprintf (obuf, "\\%o", c);
-
- if (lpos + olen >= _rl_screenwidth)
- {
- temp = _rl_screenwidth - lpos;
- CHECK_INV_LBREAKS ();
- inv_lbreaks[++newlines] = out + temp;
-#if defined (HANDLE_MULTIBYTE)
- line_state_invisible->wrapped_line[newlines] =
_rl_wrapped_multicolumn;
-#endif
- lpos = olen - temp;
- }
- else
- lpos += olen;
-
for (temp = 0; temp < olen; temp++)
{
invis_addc (&out, obuf[temp], cur_face);
- [PATCH] rl_redisplay: don't adjust cursor position twice for meta chars,
Grisha Levit <=