From 30fbf8dde47c03f571014bce60c3f7992427876e Mon Sep 17 00:00:00 2001 From: Pi Lanningham Date: Thu, 24 Oct 2024 21:16:19 -0400 Subject: [PATCH] Add 'End' hotkey Jump to the end of the script and walk backwards, useful in particular if the script is failing --- gastronomy-cli/src/app.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gastronomy-cli/src/app.rs b/gastronomy-cli/src/app.rs index 4fd4311..98e95f7 100644 --- a/gastronomy-cli/src/app.rs +++ b/gastronomy-cli/src/app.rs @@ -67,6 +67,15 @@ impl<'a> App<'a> { KeyCode::Char('q') => { self.exit = true; } + KeyCode::Char('e') | KeyCode::Char('E') => { + if key_event.modifiers.contains(event::KeyModifiers::SHIFT) { + if self.view_source { + self.cursor = self.source_token_indices.iter().last().copied().unwrap_or(self.frames.len() - 1); + } else { + self.cursor = self.frames.len() - 1; + } + } + } KeyCode::Char('N') | KeyCode::Char('n') | KeyCode::Right => { if self.view_source { self.cursor = self