fix: '/' character not working in search view
This commit is contained in:
committed by
Henrik Friedrichsen
parent
6d2a0552bf
commit
96bb2ea06b
@@ -340,7 +340,7 @@ impl View for Layout {
|
|||||||
|
|
||||||
fn on_event(&mut self, event: Event) -> EventResult {
|
fn on_event(&mut self, event: Event) -> EventResult {
|
||||||
match event {
|
match event {
|
||||||
Event::Char(':') => {
|
Event::Char(':') | Event::Char('/') => {
|
||||||
let result = if let Some(view) = self.get_current_view_mut() {
|
let result = if let Some(view) = self.get_current_view_mut() {
|
||||||
view.on_event(event.relativized((0, 1)))
|
view.on_event(event.relativized((0, 1)))
|
||||||
} else {
|
} else {
|
||||||
@@ -348,13 +348,16 @@ impl View for Layout {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if let EventResult::Ignored = result {
|
if let EventResult::Ignored = result {
|
||||||
let command_key = self.configuration.values().command_key.unwrap_or(':');
|
if let Event::Char(':') = event {
|
||||||
self.enable_cmdline(command_key);
|
let command_key = self.configuration.values().command_key.unwrap_or(':');
|
||||||
|
self.enable_cmdline(command_key);
|
||||||
|
} else {
|
||||||
|
self.enable_jump();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return EventResult::Ignored;
|
return EventResult::Ignored;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::Char('/') => self.enable_jump(),
|
|
||||||
Event::Key(Key::Esc) if self.cmdline_focus => self.clear_cmdline(),
|
Event::Key(Key::Esc) if self.cmdline_focus => self.clear_cmdline(),
|
||||||
_ if self.cmdline_focus => {
|
_ if self.cmdline_focus => {
|
||||||
let result = self.cmdline.on_event(event);
|
let result = self.cmdline.on_event(event);
|
||||||
|
|||||||
Reference in New Issue
Block a user