From bac11ceecfed8ea5c1de06547034b768e13ea89a Mon Sep 17 00:00:00 2001 From: "KOSMOS, Tzushih.K" <48860861+kisaraki@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:50:25 +0800 Subject: [PATCH] fix: use fixed-width ASCII checkbox markers --- crates/edit/src/tui.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/edit/src/tui.rs b/crates/edit/src/tui.rs index 9826c91cfc7..57d483c9caa 100644 --- a/crates/edit/src/tui.rs +++ b/crates/edit/src/tui.rs @@ -2074,17 +2074,18 @@ impl<'a> Context<'a, '_> { self.button_activated() } - /// Creates a checkbox with the given text. - /// Returns true if the checkbox was activated. + /// EN: Creates a checkbox with fixed-width ASCII markers that render consistently in terminals. + /// 中文:使用固定寬度的 ASCII 標記建立核取方塊,確保各終端機一致顯示。 + /// EN: Returns true if the checkbox was activated. + /// 中文:核取方塊被啟用時回傳 true。 pub fn checkbox(&mut self, classname: &'static str, text: &str, checked: &mut bool) -> bool { self.styled_label_begin(classname); self.attr_focusable(); if self.is_focused() { self.attr_reverse(); } - self.styled_label_add_text(if *checked { "[◼ " } else { "[◻ " }); + self.styled_label_add_text(if *checked { "[x] " } else { "[ ] " }); self.styled_label_add_text(text); - self.styled_label_add_text("]"); self.styled_label_end(); let activated = self.button_activated();