mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 13:45:12 +02:00
Some minor things like adding a question template + removal of debug.
This commit is contained in:
parent
64c788a444
commit
3f55f071b7
9
.github/ISSUE_TEMPLATE/question_template.md
vendored
Normal file
9
.github/ISSUE_TEMPLATE/question_template.md
vendored
Normal 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
|
10
src/app.rs
10
src/app.rs
@ -8,7 +8,7 @@ use data_farmer::*;
|
|||||||
use crate::{canvas, constants, utils::error::Result};
|
use crate::{canvas, constants, utils::error::Result};
|
||||||
mod process_killer;
|
mod process_killer;
|
||||||
|
|
||||||
use unicode_segmentation::GraphemeCursor;
|
use unicode_segmentation::{GraphemeCursor};
|
||||||
use unicode_width::UnicodeWidthStr;
|
use unicode_width::UnicodeWidthStr;
|
||||||
|
|
||||||
const MAX_SEARCH_LENGTH: usize = 200;
|
const MAX_SEARCH_LENGTH: usize = 200;
|
||||||
@ -618,15 +618,9 @@ impl App {
|
|||||||
|
|
||||||
/// Deletes an entire word till the next space or end
|
/// Deletes an entire word till the next space or end
|
||||||
#[allow(unused_variables)]
|
#[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 let WidgetPosition::ProcessSearch = self.current_widget_selected {
|
||||||
if self.process_search_state.search_state.is_enabled {
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 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 cursor_position = app_state.get_cursor_position();
|
||||||
let right_border = min(UnicodeWidthStr::width(query), width as usize);
|
let right_border = min(UnicodeWidthStr::width(query), width as usize);
|
||||||
debug!(
|
|
||||||
"Width: {}, query length: {}",
|
|
||||||
width,
|
|
||||||
UnicodeWidthStr::width(query)
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut itx = 0;
|
let mut itx = 0;
|
||||||
let mut query_with_cursor: Vec<Text<'_>> = if let app::WidgetPosition::ProcessSearch =
|
let mut query_with_cursor: Vec<Text<'_>> = if let app::WidgetPosition::ProcessSearch =
|
||||||
|
@ -317,7 +317,7 @@ fn handle_mouse_event(event: MouseEvent, app: &mut App) {
|
|||||||
fn handle_key_event_or_break(
|
fn handle_key_event_or_break(
|
||||||
event: KeyEvent, app: &mut App, rtx: &std::sync::mpsc::Sender<ResetEvent>,
|
event: KeyEvent, app: &mut App, rtx: &std::sync::mpsc::Sender<ResetEvent>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
//debug!("KeyEvent: {:?}", event);
|
// debug!("KeyEvent: {:?}", event);
|
||||||
|
|
||||||
// TODO: [PASTE] Note that this does NOT support some emojis like flags. This is due to us
|
// 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.
|
// 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('u') => app.clear_search(),
|
||||||
KeyCode::Char('a') => app.skip_cursor_beginning(),
|
KeyCode::Char('a') => app.skip_cursor_beginning(),
|
||||||
KeyCode::Char('e') => app.skip_cursor_end(),
|
KeyCode::Char('e') => app.skip_cursor_end(),
|
||||||
// TODO: [FEATURE] Ctrl-backspace
|
// KeyCode::Backspace => app.skip_word_backspace(),
|
||||||
// KeyCode::Backspace => app.on_skip_backspace(),
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
} else if let KeyModifiers::SHIFT = event.modifiers {
|
} else if let KeyModifiers::SHIFT = event.modifiers {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user