mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibLine: Update display when deleting forward
This commit is contained in:
parent
2a65db7c12
commit
8ebee4bce6
Notes:
sideshowbarker
2024-07-19 07:38:21 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/8ebee4bce6c Pull-request: https://github.com/SerenityOS/serenity/pull/1779 Issue: https://github.com/SerenityOS/serenity/issues/1778
@ -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…
Reference in New Issue
Block a user