mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:57:47 +00:00
LibLine: Add Alt-d binding to forward-delete a word
This commit is contained in:
parent
e521daeedc
commit
f29c5c3a41
1 changed files with 15 additions and 0 deletions
|
@ -571,6 +571,21 @@ void Editor::handle_read_event()
|
||||||
do_cursor_left(Word);
|
do_cursor_left(Word);
|
||||||
m_state = InputState::Free;
|
m_state = InputState::Free;
|
||||||
continue;
|
continue;
|
||||||
|
case 'd': // ^[d: alt-d
|
||||||
|
{
|
||||||
|
bool has_seen_nonspace = false;
|
||||||
|
while (m_cursor < m_buffer.size()) {
|
||||||
|
if (isspace(m_buffer[m_cursor])) {
|
||||||
|
if (has_seen_nonspace)
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
has_seen_nonspace = true;
|
||||||
|
}
|
||||||
|
do_delete();
|
||||||
|
}
|
||||||
|
m_state = InputState::Free;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
case 'f': // ^[f: alt-f
|
case 'f': // ^[f: alt-f
|
||||||
do_cursor_right(Word);
|
do_cursor_right(Word);
|
||||||
m_state = InputState::Free;
|
m_state = InputState::Free;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue