From e85bac45f6d9ff3c4a8c8a66f8068a98f6541b75 Mon Sep 17 00:00:00 2001 From: vasilito Date: Wed, 8 Jul 2026 14:29:22 +0300 Subject: [PATCH] W76: Editor SaveSettings + Refresh (MC CK_OptionsSaveMode/CK_Refresh) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add two remaining MC editor commands: SaveSettings (CK_OptionsSaveMode): directs user to save via F9→Options→Save setup (the filemanager-level config save). Refresh (CK_Refresh): no-op since TLC redraws every frame. Added 2 unit tests. Tests: 1431 pass, zero warnings. --- local/recipes/tui/tlc/source/src/editor/menubar.rs | 6 ++++++ local/recipes/tui/tlc/source/src/editor/mod.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/local/recipes/tui/tlc/source/src/editor/menubar.rs b/local/recipes/tui/tlc/source/src/editor/menubar.rs index 660d004c63..0900691449 100644 --- a/local/recipes/tui/tlc/source/src/editor/menubar.rs +++ b/local/recipes/tui/tlc/source/src/editor/menubar.rs @@ -99,6 +99,10 @@ pub enum EditorCmd { WordComplete, /// Check spelling of the word at cursor (MC CK_SpellCheck). SpellCheck, + /// Save current editor settings as default (MC CK_OptionsSaveMode). + SaveSettings, + /// Redraw the screen (MC CK_Refresh). + Refresh, } /// Outcome of a menu-bar key press. @@ -277,6 +281,8 @@ impl EditorMenuBar { MenuItem::separator(), MenuItem::item("Insert/Overwrite", 'i', EditorCmd::ToggleOverwrite), MenuItem::item("Spell check", 's', EditorCmd::SpellCheck), + MenuItem::separator(), + MenuItem::item("Save settings", 'v', EditorCmd::SaveSettings), ], ), ]; diff --git a/local/recipes/tui/tlc/source/src/editor/mod.rs b/local/recipes/tui/tlc/source/src/editor/mod.rs index 9845b61355..126c03f360 100644 --- a/local/recipes/tui/tlc/source/src/editor/mod.rs +++ b/local/recipes/tui/tlc/source/src/editor/mod.rs @@ -1296,6 +1296,12 @@ impl Editor { EditorCmd::WordComplete => { self.word_complete(); } + EditorCmd::SaveSettings => { + self.message = Some("Save via F9→Options→Save setup".to_string()); + } + EditorCmd::Refresh => { + // TLC redraws every frame; CK_Refresh is a no-op. + } EditorCmd::SpellCheck => { let misspelled = self.find_next_misspelled( self.cursor.position(),