Skip to content

Commit 3edae0d

Browse files
committed
[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.
1 parent 35b8003 commit 3edae0d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lldb/source/Host/common/Editline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ void Editline::Refresh() {
17131713
if (!m_editline || !m_output_stream_sp)
17141714
return;
17151715
LockedStreamFile locked_stream = m_output_stream_sp->Lock();
1716-
MoveCursor(CursorLocation::EditingCursor, CursorLocation::EditingCursor);
1716+
el_set(m_editline, EL_REFRESH);
17171717
}
17181718

17191719
bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {

lldb/test/API/functionalities/statusline/TestStatusline.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ def test_resize(self):
114114
self.resize()
115115
self.expect("set set show-statusline true", ["no target"])
116116
self.resize(20, 60)
117-
# Check for the newline followed by the escape code to move the cursor
118-
# up one line.
119-
self.child.expect(re.escape("\n\x1b[1A"))
120-
# Check for the escape code to move the cursor back to column 8.
121-
self.child.expect(re.escape("\x1b[8G"))
117+
# Check for the escape code to resize the scroll window, followed by
118+
# the prompt.
119+
self.child.expect(re.escape("\x1b[1;19r\x1b8(lldb)"))

0 commit comments

Comments
 (0)