aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorJoe2022-09-20 07:40:48 +0000
committerGitHub2022-09-20 07:40:48 +0000
commitaa00a470f31514b792e219513ffb3806a5e5b53e (patch)
tree9c2fd83d566e4e35c3f375b6b832f0adb79b5452 /helix-term/src/ui
parent1df32c917c8a386947063403577098d1277380c7 (diff)
Fix preview bug (#3644)
* Fix preview bug * Add comment to empty case
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/prompt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index d66e32be..db3bd62d 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -293,6 +293,7 @@ impl Prompt {
register: char,
direction: CompletionDirection,
) {
+ (self.callback_fn)(cx, &self.line, PromptEvent::Abort);
let register = cx.editor.registers.get_mut(register).read();
if register.is_empty() {
@@ -314,6 +315,7 @@ impl Prompt {
self.history_pos = Some(index);
self.move_end();
+ (self.callback_fn)(cx, &self.line, PromptEvent::Update);
self.recalculate_completion(cx.editor);
}
@@ -564,13 +566,11 @@ impl Component for Prompt {
ctrl!('p') | key!(Up) => {
if let Some(register) = self.history_register {
self.change_history(cx, register, CompletionDirection::Backward);
- (self.callback_fn)(cx, &self.line, PromptEvent::Update);
}
}
ctrl!('n') | key!(Down) => {
if let Some(register) = self.history_register {
self.change_history(cx, register, CompletionDirection::Forward);
- (self.callback_fn)(cx, &self.line, PromptEvent::Update);
}
}
key!(Tab) => {