From 4efeb78275de30ff70cf14cf3b97a0fbcfae9eb5 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Wed, 1 Nov 2023 12:08:08 +0100 Subject: [PATCH] add dynamic title --- lapce-app/src/window_tab.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lapce-app/src/window_tab.rs b/lapce-app/src/window_tab.rs index c096f3ba..5e22d402 100644 --- a/lapce-app/src/window_tab.rs +++ b/lapce-app/src/window_tab.rs @@ -1400,6 +1400,35 @@ pub fn run_internal_command(&self, cmd: InternalCommand) { } InternalCommand::FocusEditorTab { editor_tab_id } => { self.main_split.active_editor_tab.set(Some(editor_tab_id)); + let editor_tab = self + .main_split + .editor_tabs + .with_untracked(|tabs| tabs.get(&editor_tab_id).cloned()); + let tab_info = editor_tab + .unwrap() + .get() + .children + .get(editor_tab.unwrap().get().active) + .unwrap() + .2 + .view_info( + self.main_split.editors, + self.main_split.diff_editors, + self.plugin.clone(), + self.common.config, + ); + floem::action::set_window_title(format!( + "{} - {} - {} - Lapce", + tab_info.with(|tab| tab.path.clone()), + self.main_split + .common + .workspace + .path + .clone() + .unwrap() + .display(), + self.main_split.common.workspace.kind, + )); } InternalCommand::SetColorTheme { name, save } => { if save {