aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJonas Maier <jonas@x77.dev>2026-05-08 23:14:13 +0200
committerJonas Maier <jonas@x77.dev>2026-05-08 23:15:32 +0200
commit80f92d26fb1b9e4ca777a4b33d477451b49494d8 (patch)
tree602df274983f4bd4f0eb80f8b3fb0eb61a61769e /src/main.rs
parentce5810be396461d4b4edb4eba191f4094e0f97a8 (diff)
downloadpish-80f92d26fb1b9e4ca777a4b33d477451b49494d8.tar.gz
ctrl-backspace
Diffstat (limited to 'src/main.rs')
-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) {