Files
RedBear-OS/local
vasilito a5cfae5622 tlc: phase 21 — F11 user-menu dispatch for editor
Mirrors Midnight Commander's editor user-menu flow (MC
src/editor/edit.c::edit_user_menu + CK_UserMenu).

Architecture reuses the existing filemanager usermenu infra:
  filemanager::usermenu::UserMenuDialog is constructed with
  condition='edit' so the same ~/.config/tlc/menu file works
  in both filemanager (condition='view') and editor contexts.

Components:
  src/editor/usermenu.rs (new) — EditorUserMenu wrapper that
    owns the dialog + cursor snapshot + selection flag +
    clipfile path. Plus  reuses
    PercentCtx::for_file; default_block_file() resolves
    /tlc/editor.block or ~/.config/tlc/editor.block.

  src/editor/menubar.rs — adds EditorCmd::UserMenu and
    EditorCmd::EditUserMenu variants (cross-referenced MC
    CK_UserMenu + CK_EditUserMenu).

  src/editor/mod.rs — new usermenu_session: Option<EditorUserMenu>
    field, init None in both constructors, Editor::open_user_menu
    method, dispatch_editor_cmd wires UserMenu/EditUserMenu
    variants (EditUserMenu surfaces path via status message —
    full Open wiring deferred to follow-up).

  src/editor/handlers.rs — F11 keybind opens user menu (F11 is
    MC's editor UserMenu binding per misc/mc.default.keymap;
    F2 in the editor is reserved for Save). Routing at top of
    handle_key intercepts Running/Cancel/Execute outcomes;
    Execute surfaces the command in the status line — full
    selection-stash + stdout-capture is deferred TODO.

Tests: 1137 passed (was 1132, +5: 4 editor::usermenu module
tests covering expand, default_block_file, EditorUserMenu
construction, key routing; 1 handler test for F11 open + Esc close).
2026-06-20 21:14:01 +03:00
..