From aafb6131948e4faacf6cf293879ccdf852f89be8 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sun, 16 Aug 2026 03:26:19 +0800 Subject: [PATCH] refactor(app): drop an opener nothing has called since the first commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `open_config_file` has been `#[allow(dead_code)]` since 22e1ab16 — the initial commit — with nothing to say why. It is not staged for anything: it was dead when it arrived. It also hand-rolls a platform opener, picking between `open`, `explorer` and `xdg-open` itself, while this file already reaches for `cx.open_with_system` two thousand lines up and `terminal::view:: open_file_path` exists for the same job. Whoever wires an "open config.json" affordance will write one line, not these twenty, and will get the error reporting the file-link opener already has. The other `allow(dead_code)` nearby is the counter-example and stays: `palette::CheckoutBranch` says in its doc what it is waiting for — "nothing emits it until the picker can list refs" — which is a parked feature rather than a forgotten one. An allow that explains itself is worth keeping; this one never did. --- src/ui/app.rs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/ui/app.rs b/src/ui/app.rs index d6d323a8..a4c93a74 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -6542,26 +6542,6 @@ impl Tty7App { crate::ui::keymap::rebind(cx); cx.notify(); } - - #[allow(dead_code)] - pub(crate) fn open_config_file(&self, cx: &Context) { - let Some(path) = crate::core::config::config_path("config.json") else { - return; - }; - if !path.exists() { - cx.global::().save(); - } - let opener = if cfg!(target_os = "macos") { - "open" - } else if cfg!(windows) { - "explorer" - } else { - "xdg-open" - }; - if let Err(e) = std::process::Command::new(opener).arg(&path).spawn() { - log::warn!("failed to open {}: {e}", path.display()); - } - } } #[cfg(test)]