aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index a82eea6..a4a6f00 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -244,7 +244,21 @@ impl Session {
}
fn del_left_word(&mut self) {
- todo!()
+ let mut del = 0;
+ while let Some(x) = self.line.get_left()
+ && x == b' '
+ {
+ self.line.del_left();
+ del += 1;
+ }
+ while let Some(x) = self.line.get_left()
+ && x != b' '
+ {
+ self.line.del_left();
+ del += 1;
+ }
+ cursor::move_cursor(Direction::Left, del);
+ self.line.display_post(&vec![b' '; del]);
}
fn del_right_word(&mut self) {