From 42a83b1245290a2a4f59891924734661505172c2 Mon Sep 17 00:00:00 2001 From: alice pellerin Date: Sat, 16 May 2026 16:25:47 -0500 Subject: [PATCH] normal escape stop inspecting --- src/action.rs | 8 ++++++++ src/buffer/actions.rs | 2 ++ src/config/default.rs | 2 ++ todo.md | 1 - 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/action.rs b/src/action.rs index 4b71cdb..2d7c4b6 100644 --- a/src/action.rs +++ b/src/action.rs @@ -190,6 +190,8 @@ pub enum BufferAction { InspectSelection, InspectSelectionColor, + + StopInspecting, } impl BufferAction { @@ -264,6 +266,8 @@ impl BufferAction { InspectSelection => true, InspectSelectionColor => true, + + StopInspecting => true, } } } @@ -339,6 +343,8 @@ impl From for &str { InspectSelection => "inspect_selection", InspectSelectionColor => "inspect_selection_color", + + StopInspecting => "stop_inspecting", } } } @@ -423,6 +429,8 @@ impl TryFrom<&str> for BufferAction { "inspect_selection" => Ok(InspectSelection), "inspect_selection_color" => Ok(InspectSelectionColor), + "stop_inspecting" => Ok(StopInspecting), + _ => Err(()), } } diff --git a/src/buffer/actions.rs b/src/buffer/actions.rs index 1e18214..31b44cd 100644 --- a/src/buffer/actions.rs +++ b/src/buffer/actions.rs @@ -72,6 +72,8 @@ impl Buffer { BufferAction::InspectSelection => self.inspect_selection(), BufferAction::InspectSelectionColor => self.inspect_selection_color(), + + BufferAction::StopInspecting => {}, } } diff --git a/src/config/default.rs b/src/config/default.rs index 8b8c352..4e69765 100644 --- a/src/config/default.rs +++ b/src/config/default.rs @@ -92,6 +92,8 @@ impl Default for Config { (keypress("C- "), InspectSelection.into()), (keypress("A- "), InspectSelectionColor.into()), + + (keypress("escape"), StopInspecting.into()), ].into()), (Some(PartialAction::Goto), [ (keypress("j"), GotoLineStart.into()), diff --git a/todo.md b/todo.md index f4fe8eb..a0cc4ab 100644 --- a/todo.md +++ b/todo.md @@ -1,6 +1,5 @@ # todo - v1.0 - - `` dismiss inspectors - `T` Till - click on tab to go to buffer - `go` goto entered offset