1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

lineedit: add ctrl-w to delete word up to cursor

This commit is contained in:
Wez Furlong 2019-05-27 09:21:19 -07:00
parent 56885e5bad
commit 0d2bbcfce6

View File

@ -29,6 +29,7 @@
//! Ctrl-J, Ctrl-M, Enter | Finish line editing and accept the current line
//! Ctrl-K | Delete from cursor to end of line
//! Ctrl-L | Move the cursor to the top left, clear screen and repaint
//! Ctrl-W | Delete word leading up to cursor
//! Alt-b, Alt-Left | Move the cursor backwards one word
//! Alt-f, Alt-Right | Move the cursor forwards one word
use crate::caps::{Capabilities, ProbeHintsBuilder};
@ -160,6 +161,12 @@ impl<T: Terminal> LineEditor<T> {
modifiers: Modifiers::NONE,
}) => Some(Action::Move(Movement::BackwardChar(1))),
InputEvent::Key(KeyEvent {
key: KeyCode::Char('W'),
modifiers: Modifiers::CTRL,
})
=> Some(Action::Kill(Movement::BackwardWord(1))),
InputEvent::Key(KeyEvent {
key: KeyCode::Char('b'),
modifiers: Modifiers::ALT,