diff --git a/hac-client/src/app.rs b/hac-client/src/app.rs index 28749e9..71bcdfc 100755 --- a/hac-client/src/app.rs +++ b/hac-client/src/app.rs @@ -23,7 +23,6 @@ impl<'app> App<'app> { config: &'app hac_config::Config, dry_run: bool, ) -> anyhow::Result { - let terminal = Terminal::new(CrosstermBackend::new(std::io::stdout()))?; Ok(Self { screen_manager: ScreenManager::new( diff --git a/hac-client/src/pages/collection_viewer/request_editor.rs b/hac-client/src/pages/collection_viewer/request_editor.rs index 078a672..87a08d5 100755 --- a/hac-client/src/pages/collection_viewer/request_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor.rs @@ -162,7 +162,7 @@ impl<'re> RequestEditor<'re> { ReqEditorTabs::Body => self.body_editor.draw(frame, size)?, ReqEditorTabs::Headers => self.headers_editor.draw(frame, size)?, ReqEditorTabs::Query => UnderConstruction::new(self.colors).draw(frame, size)?, - ReqEditorTabs::Auth => self.auth_editor.draw(frame, size)?, + ReqEditorTabs::Auth => UnderConstruction::new(self.colors).draw(frame, size)?, } Ok(()) @@ -285,13 +285,17 @@ impl Eventful for RequestEditor<'_> { }, ReqEditorTabs::Headers => match self.headers_editor.handle_key_event(key_event)? { Some(HeadersEditorEvent::Quit) => return Ok(Some(RequestEditorEvent::Quit)), + Some(HeadersEditorEvent::RemoveSelection) => { + return Ok(Some(RequestEditorEvent::RemoveSelection)) + } None => {} }, ReqEditorTabs::Query => {} - ReqEditorTabs::Auth => match self.auth_editor.handle_key_event(key_event)? { - Some(_) => todo!(), - None => {} - }, + ReqEditorTabs::Auth => { + if (self.auth_editor.handle_key_event(key_event)?).is_some() { + todo!() + } + } } Ok(None) diff --git a/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs index 72fa323..297b58b 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs @@ -5,12 +5,12 @@ use crate::pages::{Eventful, Renderable}; #[derive(Debug)] pub struct AuthEditor<'ae> { - colors: &'ae hac_colors::colors::Colors, + _colors: &'ae hac_colors::colors::Colors, } impl<'ae> AuthEditor<'ae> { pub fn new(colors: &'ae hac_colors::colors::Colors) -> Self { - AuthEditor { colors } + AuthEditor { _colors: colors } } } @@ -25,7 +25,7 @@ impl Renderable for AuthEditor<'_> { impl Eventful for AuthEditor<'_> { type Result = (); - fn handle_key_event(&mut self, key_event: KeyEvent) -> anyhow::Result> { + fn handle_key_event(&mut self, _key_event: KeyEvent) -> anyhow::Result> { Ok(None) } } diff --git a/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs index 641939a..9f4d301 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs @@ -43,7 +43,7 @@ pub struct BodyEditor<'be> { /// Only KeyAction::Complex are stored here as any other kind of key action can be acted upon /// instantly keymap_buffer: Option, - collection_store: Rc>, + _collection_store: Rc>, } impl<'be> BodyEditor<'be> { @@ -60,7 +60,7 @@ impl<'be> BodyEditor<'be> { Self { body, tree, - collection_store, + _collection_store: collection_store, styled_display, cursor: Cursor::default(), editor_mode: EditorMode::Normal, diff --git a/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs index 9ca7b9b..199e10f 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs @@ -23,6 +23,7 @@ use super::headers_editor_edit_form::{HeadersEditorForm, HeadersEditorFormEvent} #[derive(Debug)] pub enum HeadersEditorEvent { Quit, + RemoveSelection, } #[derive(Debug)] @@ -438,6 +439,7 @@ impl Eventful for HeadersEditor<'_> { .borrow_mut() .push_overlay(CollectionViewerOverlay::HeadersForm(self.selected_row)); } + KeyCode::Esc => return Ok(Some(HeadersEditorEvent::RemoveSelection)), KeyCode::Char('n') => { let idx = headers.len(); headers.push(HeaderMap { diff --git a/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs b/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs index cc9001e..6766369 100644 --- a/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs +++ b/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs @@ -1,5 +1,3 @@ -use hac_core::collection::types::*; - use crate::ascii::LOGO_ASCII; use crate::pages::collection_viewer::collection_store::CollectionStore; use crate::pages::input::Input;