[lldb] Use EL_REFRESH to refresh Editline

Letting Editline refresh itself is more robust and ensures that the
current text is redraw if it was accidentally cleared. In that scenario
MoveCursor would only fix up the cursor position.
This commit is contained in:
Jonas Devlieghere 2025-07-01 11:04:49 -07:00
parent 35b80031f4
commit 3edae0d5e5
No known key found for this signature in database
GPG Key ID: 49CC0BD90FDEED4D
2 changed files with 4 additions and 6 deletions

View File

@ -1713,7 +1713,7 @@ void Editline::Refresh() {
if (!m_editline || !m_output_stream_sp)
return;
LockedStreamFile locked_stream = m_output_stream_sp->Lock();
MoveCursor(CursorLocation::EditingCursor, CursorLocation::EditingCursor);
el_set(m_editline, EL_REFRESH);
}
bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {

View File

@ -114,8 +114,6 @@ class TestStatusline(PExpectTest):
self.resize()
self.expect("set set show-statusline true", ["no target"])
self.resize(20, 60)
# Check for the newline followed by the escape code to move the cursor
# up one line.
self.child.expect(re.escape("\n\x1b[1A"))
# Check for the escape code to move the cursor back to column 8.
self.child.expect(re.escape("\x1b[8G"))
# Check for the escape code to resize the scroll window, followed by
# the prompt.
self.child.expect(re.escape("\x1b[1;19r\x1b8(lldb)"))