Commit 82a657f7a0

82a657f7a0a089a57fb1dcf13a6953251fa03b60

parent: 8e00f21be8

Unsigned

Siriusmart <71584876+Siriusmart@users.noreply.github.com> · 2023-07-26 08:39 UTC

fixed annoying issue where pressing space in searchbar plays hovered video

Layout: unified · split

src/global/functions/key_input.rs +18 −18
@@ -16,24 +16,6 @@ pub fn key_input(
1616 framework: &mut Framework,
1717 terminal: &mut Terminal<CrosstermBackend<Stdout>>,
1818) {
19 // check if key binds to any commands
20 let command_to_run = framework
21 .data
22 .global
23 .get::<CommandBindings>()
24 .unwrap()
25 .get_command(&key, framework.data.state.get::<Page>().unwrap());
26 if !command_to_run.is_empty() {
27 run_command(&apply_envs(command_to_run), framework, terminal);
28 framework
29 .data
30 .state
31 .get_mut::<Tasks>()
32 .unwrap()
33 .priority
34 .push(Task::RenderAll);
35 }
36
3719 // 1. get the corresponding action
3820 // 2. check if action is deselect, if yes, deselect
3921 // 3. check is anything is selected, if yes, run `.key_event()` with the key
@@ -108,6 +90,24 @@ pub fn key_input(
10890 }
10991 }
11092
93 // check if key binds to any commands
94 let command_to_run = framework
95 .data
96 .global
97 .get::<CommandBindings>()
98 .unwrap()
99 .get_command(&key, framework.data.state.get::<Page>().unwrap());
100 if !command_to_run.is_empty() {
101 run_command(&apply_envs(command_to_run), framework, terminal);
102 framework
103 .data
104 .state
105 .get_mut::<Tasks>()
106 .unwrap()
107 .priority
108 .push(Task::RenderAll);
109 }
110
111111 if let Some(action) = action {
112112 let mut render = true;
113113 match action {