diff --git a/crates/tek/src/tui/phrase_editor.rs b/crates/tek/src/tui/phrase_editor.rs index 8f23b02b..66ddafdf 100644 --- a/crates/tek/src/tui/phrase_editor.rs +++ b/crates/tek/src/tui/phrase_editor.rs @@ -614,6 +614,7 @@ impl InputToCommand for PhraseCommand { let time_point = state.time_point.load(Ordering::Relaxed); let time_zoom = state.view_mode.time_zoom(); let length = state.phrase.as_ref().map(|p|p.read().unwrap().length).unwrap_or(1); + let note_len = state.note_len; Some(match from.event() { key!(Char('`')) => ToggleDirection, key!(Esc) => SetEditMode(PhraseEditMode::Scroll), @@ -633,18 +634,20 @@ impl InputToCommand for PhraseCommand { key!(Down) => SetNoteScroll(note_lo.saturating_sub(1)), key!(PageUp) => SetNoteScroll(note_lo + 3), key!(PageDown) => SetNoteScroll(note_lo.saturating_sub(3)), - key!(Left) => SetTimeScroll(time_start.saturating_sub(1)), - key!(Right) => SetTimeScroll(time_start + 1), + key!(Left) => SetTimeScroll(time_start.saturating_sub(time_zoom)), + key!(Right) => SetTimeScroll(time_start + time_zoom), _ => return None }, PhraseEditMode::Note => match from.event() { - key!(Char('e')) => SetEditMode(PhraseEditMode::Scroll), - key!(Up) => SetNoteCursor(note_point + 1), - key!(Down) => SetNoteCursor(note_point.saturating_sub(1)), - key!(PageUp) => SetNoteCursor(note_point + 3), - key!(PageDown) => SetNoteCursor(note_point.saturating_sub(3)), - key!(Left) => SetTimeCursor(time_point.saturating_sub(time_zoom)), - key!(Right) => SetTimeCursor((time_point + time_zoom) % length), + key!(Char('e')) => SetEditMode(PhraseEditMode::Scroll), + key!(Up) => SetNoteCursor(note_point + 1), + key!(Down) => SetNoteCursor(note_point.saturating_sub(1)), + key!(PageUp) => SetNoteCursor(note_point + 3), + key!(PageDown) => SetNoteCursor(note_point.saturating_sub(3)), + key!(Left) => SetTimeCursor(time_point.saturating_sub(note_len)), + key!(Right) => SetTimeCursor((time_point + note_len) % length), + key!(Shift-Left) => SetTimeCursor(time_point.saturating_sub(time_zoom)), + key!(Shift-Right) => SetTimeCursor((time_point + time_zoom) % length), _ => return None }, }