From 3f55f071b7acd4fe5727d2d9ca0c5e5d992c7703 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Thu, 27 Feb 2020 22:50:43 -0500 Subject: [PATCH] Some minor things like adding a question template + removal of debug. --- .github/ISSUE_TEMPLATE/question_template.md | 9 +++++++++ src/app.rs | 10 ++-------- src/canvas.rs | 5 ----- src/main.rs | 5 ++--- 4 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/question_template.md diff --git a/.github/ISSUE_TEMPLATE/question_template.md b/.github/ISSUE_TEMPLATE/question_template.md new file mode 100644 index 00000000..70ea51dc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question_template.md @@ -0,0 +1,9 @@ +--- +name: Question? +about: If you've just got a question, feel free to ask here. +title: "" +labels: "question" +assignees: "" +--- + +## Question diff --git a/src/app.rs b/src/app.rs index c2a3f6cb..5131b720 100644 --- a/src/app.rs +++ b/src/app.rs @@ -8,7 +8,7 @@ use data_farmer::*; use crate::{canvas, constants, utils::error::Result}; mod process_killer; -use unicode_segmentation::GraphemeCursor; +use unicode_segmentation::{GraphemeCursor}; use unicode_width::UnicodeWidthStr; const MAX_SEARCH_LENGTH: usize = 200; @@ -618,15 +618,9 @@ impl App { /// Deletes an entire word till the next space or end #[allow(unused_variables)] - pub fn on_skip_backspace(&mut self) { + pub fn skip_word_backspace(&mut self) { if let WidgetPosition::ProcessSearch = self.current_widget_selected { if self.process_search_state.search_state.is_enabled { - // Starting from the current position, work backwards on each char until we hit whitespace - let search_chars = self - .process_search_state - .search_state - .current_search_query - .chars(); } } } diff --git a/src/canvas.rs b/src/canvas.rs index e13afcf7..024cf6bf 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -1166,11 +1166,6 @@ impl Painter { let grapheme_indices = UnicodeSegmentation::grapheme_indices(query, true).rev(); // Reverse due to us wanting to draw from back -> front let cursor_position = app_state.get_cursor_position(); let right_border = min(UnicodeWidthStr::width(query), width as usize); - debug!( - "Width: {}, query length: {}", - width, - UnicodeWidthStr::width(query) - ); let mut itx = 0; let mut query_with_cursor: Vec> = if let app::WidgetPosition::ProcessSearch = diff --git a/src/main.rs b/src/main.rs index ef0b506d..4d65d2ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -317,7 +317,7 @@ fn handle_mouse_event(event: MouseEvent, app: &mut App) { fn handle_key_event_or_break( event: KeyEvent, app: &mut App, rtx: &std::sync::mpsc::Sender, ) -> bool { - //debug!("KeyEvent: {:?}", event); + // debug!("KeyEvent: {:?}", event); // TODO: [PASTE] Note that this does NOT support some emojis like flags. This is due to us // catching PER CHARACTER right now WITH A forced throttle! This means multi-char will not work. @@ -399,8 +399,7 @@ fn handle_key_event_or_break( KeyCode::Char('u') => app.clear_search(), KeyCode::Char('a') => app.skip_cursor_beginning(), KeyCode::Char('e') => app.skip_cursor_end(), - // TODO: [FEATURE] Ctrl-backspace - // KeyCode::Backspace => app.on_skip_backspace(), + // KeyCode::Backspace => app.skip_word_backspace(), _ => {} } } else if let KeyModifiers::SHIFT = event.modifiers {