[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] [PATCH] fix cursor position when prompt has one invisible

From: Miroslav Lichvar
Subject: [Bug-readline] [PATCH] fix cursor position when prompt has one invisible character
Date: Fri, 2 Nov 2007 14:07:45 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

When readline() is called with string "\001\017\002xyz" as prompt, the
cursor position will be wrong. The problem occurs when the first
character in the prompt is an invisible character and it's the only
invisible character in the string.

The following patch fixes the problem.

--- readline-5.2/display.c.inv
+++ readline-5.2/display.c
@@ -943,7 +943,7 @@ rl_redisplay ()
                  cpos_adjusted == 0 &&
                  _rl_last_c_pos != o_cpos &&
                  _rl_last_c_pos > wrap_offset &&
-                 o_cpos < prompt_last_invisible)
+                 o_cpos <= prompt_last_invisible)
                _rl_last_c_pos -= wrap_offset;
              /* If this is the line with the prompt, we might need to

Miroslav Lichvar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]