From ed6a4c4bd240630355d1c61a1c05c4e22bf62a86 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 14 Dec 2020 14:12:54 +0900 Subject: wip: Use prompt for interactive commands. --- helix-term/src/ui/prompt.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index ce00a129..d1d92975 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -10,7 +10,6 @@ pub struct Prompt { pub line: String, pub cursor: usize, pub completion: Vec, - pub should_close: bool, pub completion_selection_index: Option, completion_fn: Box Vec>, callback_fn: Box, @@ -27,7 +26,6 @@ impl Prompt { line: String::new(), cursor: 0, completion: completion_fn(""), - should_close: false, completion_selection_index: None, completion_fn: Box::new(completion_fn), callback_fn: Box::new(callback_fn), @@ -42,9 +40,7 @@ impl Prompt { } pub fn move_char_left(&mut self) { - if self.cursor > 0 { - self.cursor -= 1; - } + self.cursor = self.cursor.saturating_sub(1) } pub fn move_char_right(&mut self) { -- cgit v1.2.3-70-g09d2