mirror of
https://github.com/helix-editor/helix.git
synced 2024-09-11 18:58:00 +03:00
Don't add empty prompt input to history (#3259)
This commit is contained in:
parent
a8b123fe17
commit
5ca98edfb1
@ -533,16 +533,17 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
||||
.map(|entry| entry.into())
|
||||
.unwrap_or_else(|| Cow::from(""))
|
||||
} else {
|
||||
if let Some(register) = self.history_register {
|
||||
// store in history
|
||||
let register = cx.editor.registers.get_mut(register);
|
||||
register.push(self.line.clone());
|
||||
}
|
||||
|
||||
self.line.as_str().into()
|
||||
};
|
||||
|
||||
(self.callback_fn)(cx, &input, PromptEvent::Validate);
|
||||
|
||||
if let Some(register) = self.history_register {
|
||||
// store in history
|
||||
let register = cx.editor.registers.get_mut(register);
|
||||
register.push(self.line.clone());
|
||||
}
|
||||
return close_fn;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user