sequencer: compact sidebar

This commit is contained in:
🪞👃🪞 2024-08-22 16:18:57 +03:00
parent a0109bce9b
commit ea463db139
2 changed files with 64 additions and 16 deletions

View file

@ -60,6 +60,14 @@ handle!(ArrangerRenameModal |self, e| {
KeyCode::Right => {
self.cursor = self.value.len().min(self.cursor + 1)
},
KeyCode::Backspace => {
let last = self.value.len().saturating_sub(1);
self.value = format!("{}{}",
&self.value[0..self.cursor.min(last)],
&self.value[self.cursor.min(last)..last]
);
self.cursor = self.cursor.saturating_sub(1)
}
KeyCode::Char(c) => {
self.value.insert(self.cursor, c);
self.cursor = self.value.len().min(self.cursor + 1)