mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
LibLine: Update display when deleting forward
This commit is contained in:
parent
2a65db7c12
commit
8ebee4bce6
1 changed files with 7 additions and 9 deletions
|
@ -152,14 +152,6 @@ String Editor::get_line(const String& prompt)
|
|||
}
|
||||
|
||||
auto reverse_tab = false;
|
||||
auto do_delete = [&] {
|
||||
if (m_cursor == m_buffer.size()) {
|
||||
fputc('\a', stdout);
|
||||
fflush(stdout);
|
||||
return;
|
||||
}
|
||||
m_buffer.remove(m_cursor);
|
||||
};
|
||||
auto increment_suggestion_index = [&] {
|
||||
m_next_suggestion_index = (m_next_suggestion_index + 1) % m_suggestions.size();
|
||||
};
|
||||
|
@ -235,7 +227,13 @@ String Editor::get_line(const String& prompt)
|
|||
m_state = InputState::Free;
|
||||
break;
|
||||
case '3':
|
||||
do_delete();
|
||||
if (m_cursor == m_buffer.size()) {
|
||||
fputc('\a', stdout);
|
||||
fflush(stdout);
|
||||
continue;
|
||||
}
|
||||
m_buffer.remove(m_cursor);
|
||||
m_refresh_needed = true;
|
||||
m_state = InputState::ExpectTerminator;
|
||||
continue;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue