Triggers the search panel in an editor by focusing it and dispatching Cmd+F.
(editor: Option<Entity<InputState>>, window: &Window)
| 3 | |
| 4 | /// Triggers the search panel in an editor by focusing it and dispatching Cmd+F. |
| 5 | pub fn trigger_editor_search(editor: Option<Entity<InputState>>, window: &Window) { |
| 6 | window.on_next_frame(move |window, cx| { |
| 7 | if let Some(editor) = editor { |
| 8 | editor.update(cx, |state, cx| { |
| 9 | state.focus(window, cx); |
| 10 | }); |
| 11 | if let Ok(keystroke) = Keystroke::parse("cmd-f") { |
| 12 | window.dispatch_keystroke(keystroke, cx); |
| 13 | } |
| 14 | } |
| 15 | }); |
| 16 | } |
no outgoing calls
no test coverage detected