mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibLine: Treat ^D as EOF only when the buffer is empty
As opposed to when the cursor is at the start of the buffer. Fixes #3421.
This commit is contained in:
parent
18ff9c3fc2
commit
39d14c22d1
Notes:
sideshowbarker
2024-07-19 02:51:35 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/39d14c22d18 Pull-request: https://github.com/SerenityOS/serenity/pull/3422 Issue: https://github.com/SerenityOS/serenity/issues/3421
1 changed files with 2 additions and 1 deletions
|
@ -738,7 +738,8 @@ void Editor::handle_read_event()
|
|||
|
||||
// Normally ^D. `stty eof \^n` can change it to ^N (or something else), but Serenity doesn't have `stty` yet.
|
||||
// Process this here since the keybinds might override its behaviour.
|
||||
if (code_point == m_termios.c_cc[VEOF] && m_cursor == 0) {
|
||||
// This only applies when the buffer is empty. at any other time, the behaviour should be configurable.
|
||||
if (code_point == m_termios.c_cc[VEOF] && m_buffer.size() == 0) {
|
||||
finish_edit();
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue