From 99071997d56dd6887afad3e9f2822aaaef07fc22 Mon Sep 17 00:00:00 2001 From: TomZz Date: Fri, 12 Jun 2026 20:38:11 +0800 Subject: [PATCH] Merge PR 9, refactor codebase and manually resolve conflicts while retaining all recent main branch features --- src/app.rs | 14 ++++++++------ src/main.rs | 4 ++-- src/terminal_element.rs | 2 +- src/ui.rs | 2 ++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/app.rs b/src/app.rs index 540a0aa..746a770 100644 --- a/src/app.rs +++ b/src/app.rs @@ -297,7 +297,7 @@ impl Ashell { sftp_creating_folder: false, sftp_new_folder_input, sftp_delete_scroll_handle: gpui::ScrollHandle::new(), - show_hidden_files: false, + show_hidden_files: config.show_hidden_files(), transfers: config.transfers(), show_transfers_dialog: false, system_status: None, @@ -640,19 +640,21 @@ impl Ashell { &self, range_utf16: Range, element_bounds: Bounds, + cell_width: f32, + line_height: f32, ) -> Option> { let snapshot = self.active_snapshot()?; let cursor = snapshot.cursor?; let x = element_bounds.origin.x - + px(self.terminal_cell_width()) * cursor.col as f32 - + px(self.terminal_cell_width()) * range_utf16.start as f32; + + px(cell_width) * cursor.col as f32 + + px(cell_width) * range_utf16.start as f32; let y = element_bounds.origin.y - + px(self.terminal_line_height()) * cursor.row as f32; + + px(line_height) * cursor.row as f32; Some(Bounds::new( point(x, y), size( - px(self.terminal_cell_width()), - px(self.terminal_line_height()), + px(cell_width), + px(line_height), ), )) } diff --git a/src/main.rs b/src/main.rs index aa0ff2b..43c69e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,7 +71,7 @@ fn load_embedded_themes(cx: &mut App) { #[cfg(target_os = "macos")] fn sync_macos_launch_environment() { let shell = std::env::var("SHELL").unwrap_or_else(|_| "/bin/zsh".to_string()); - let Ok(output) = Command::new(&shell).args(["-l", "-c", "env -0"]).output() else { + let Ok(output) = std::process::Command::new(&shell).args(["-l", "-c", "env -0"]).output() else { return; }; if !output.status.success() { @@ -240,7 +240,7 @@ fn main() { #[cfg(target_os = "macos")] let app = gpui_platform::application() .with_assets(Assets) - .with_quit_mode(QuitMode::Explicit); + .with_quit_mode(gpui::QuitMode::Explicit); #[cfg(not(target_os = "macos"))] let app = gpui_platform::application().with_assets(Assets); diff --git a/src/terminal_element.rs b/src/terminal_element.rs index f18aba1..ecec7e7 100644 --- a/src/terminal_element.rs +++ b/src/terminal_element.rs @@ -221,7 +221,7 @@ impl InputHandler for TerminalInputHandler { ) -> Option> { self.view .read(cx) - .terminal_ime_bounds_for_range(range_utf16, self.element_bounds) + .terminal_ime_bounds_for_range(range_utf16, self.element_bounds, self.cell_width, self.line_height) } fn character_index_for_point( diff --git a/src/ui.rs b/src/ui.rs index 03a4635..d5ae2a2 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -180,6 +180,8 @@ impl Ashell { .tab_stop(false) .on_click(cx.listener(|this, checked, _, cx| { this.show_hidden_files = *checked; + this.config.set_show_hidden_files(*checked); + let _ = this.config.save(); cx.notify(); })), )