fix repeated actions error, add yank message

This commit is contained in:
alice pellerin
2026-04-26 01:02:04 -05:00
parent fd63c6bd57
commit 3ad74cc3de
3 changed files with 22 additions and 16 deletions
+7 -1
View File
@@ -34,7 +34,7 @@ impl App {
}
pub fn yank(&mut self) {
let current_buffer = &self.buffers[self.current_buffer_index];
let current_buffer = &mut self.buffers[self.current_buffer_index];
self.primary_cursor_register = current_buffer
.contents[current_buffer.primary_cursor.range()]
@@ -46,5 +46,11 @@ impl App {
current_buffer.contents[cursor.range()].to_vec()
})
.collect();
current_buffer.alert_message = if current_buffer.cursors.is_empty() {
"yanked 1 selection".into()
} else {
format!("yanked {} selections", current_buffer.cursors.len() + 1).into()
};
}
}