Some minor things like adding a question template + removal of debug.

This commit is contained in:
ClementTsang 2020-02-27 22:50:43 -05:00
parent 64c788a444
commit 3f55f071b7
4 changed files with 13 additions and 16 deletions

View file

@ -0,0 +1,9 @@
---
name: Question?
about: If you've just got a question, feel free to ask here.
title: ""
labels: "question"
assignees: ""
---
## Question

View file

@ -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();
}
}
}

View file

@ -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<Text<'_>> = if let app::WidgetPosition::ProcessSearch =

View file

@ -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<ResetEvent>,
) -> 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 {