From 946452ad6e216e8051cea47c1d4207055cda45e9 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Wed, 4 May 2022 17:22:01 +0100 Subject: [PATCH] global search select all --- lapce-data/src/data.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lapce-data/src/data.rs b/lapce-data/src/data.rs index 70a43b65..d78cfdf8 100644 --- a/lapce-data/src/data.rs +++ b/lapce-data/src/data.rs @@ -15,7 +15,9 @@ Rect, Size, Target, Vec2, WidgetId, WindowId, }; -use lapce_core::{mode::MotionMode, register::Register}; +use lapce_core::{ + command::MultiSelectionCommand, mode::MotionMode, register::Register, +}; use lapce_rpc::{ file::FileNodeItem, plugin::PluginDescription, source_control::FileDiff, terminal::TermId, @@ -1648,6 +1650,18 @@ fn show_panel(&mut self, ctx: &mut EventCtx, kind: PanelKind) { PanelKind::Search => self.search.active, PanelKind::Problem => self.problem.widget_id, }; + if let PanelKind::Search = kind { + ctx.submit_command(Command::new( + LAPCE_COMMAND, + LapceCommand { + kind: CommandKind::MultiSelection( + MultiSelectionCommand::SelectAll, + ), + data: None, + }, + Target::Widget(focus_id), + )); + } ctx.submit_command(Command::new( LAPCE_UI_COMMAND, LapceUICommand::Focus,