this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

planning more keyboard shortcuts

alice 220440c1 e65d5298

+69
+1
docs/README.md
··· 6 6 - `docs/roadmap/overview.md`: High-level phased roadmap and goals (moved from RUST_REWRITE.md). 7 7 - `docs/roadmap/gui_first.md`: Combined GUI-first kickoff + milestones for `winit + pixels` and `cls/pix`. 8 8 - `docs/roadmap/editor_livecoding.md`: Livecoding editor plan (TIC‑80 UI vibes): CODE + CONSOLE only. 9 + - `docs/roadmap/editor_shortcuts.md`: Implementation checklist for PageUp/Down, Shift variants, Ctrl+Home/End, and block indent/outdent. 9 10 - `docs/roadmap/todos_code_review.md`: Rolling TODOs from code review (high/medium/low priority) with checkboxes. 10 11 - `docs/roadmap/todos_from_ai_review.md`: Rolling TODOs from AI code review (2025-08-27). 11 12
+68
docs/roadmap/editor_shortcuts.md
··· 1 + # Editor Shortcuts — Phase Checklist (CODE View) 2 + 3 + Status: planning (to drive implementation and tests) 4 + 5 + This document tracks keyboard navigation and indentation features for the CODE view. It is the authoritative TODO checklist to implement, test, and verify parity with TIC‑80 behavior. Items will be checked off as work lands. 6 + 7 + ## Scope (Phase 1) 8 + 9 + - [ ] Page Up / Page Down (plain) 10 + - Move caret up/down by visible line count (viewport height / 7), clamped. 11 + - Maintain a virtual column (desired x) across ragged lines. 12 + - Ensure caret remains visible by adjusting `scroll_line`. 13 + - Tests: basic motion, clamping, viewport re-centering/visibility. 14 + 15 + - [ ] Page Up / Page Down with Shift 16 + - Same movement but extend selection from anchor. 17 + - If no active selection, set anchor at caret before moving. 18 + - Tests: selection spans exactly N rows; correct range regardless of direction. 19 + 20 + - [ ] Ctrl+Home / Ctrl+End 21 + - Ctrl+Home → caret to (0,0); Ctrl+End → caret to (last line, `line_len(last)`). 22 + - Adjust viewport so caret is visible. 23 + - Tests: motion to start/end; clamping; viewport visibility. 24 + 25 + - [ ] Block Indent / Outdent (Tab / Shift+Tab) 26 + - When selection spans lines: 27 + - Tab → insert one leading space on each selected line. 28 + - Shift+Tab → remove one leading space when present. 29 + - Keep selection aligned to the same visual text after edits (adjust anchor/caret indices). 30 + - Undo/redo batching per operation (indent or outdent). 31 + - Tests: indent/outdent single- and multi-line selections; no-op when no leading space; undo/redo restores reliably. 32 + 33 + ## Integration Notes 34 + 35 + - Platform modifiers 36 + - When this document says “Ctrl”, it means “Cmd” on macOS and “Ctrl” on Windows/Linux. The key handling treats either the Control or the “Logo” (Command) modifier as the shortcut modifier, consistent with existing copy/paste/undo/redo handling. 37 + - Shift variants behave the same on all platforms. PageUp/PageDown are used as delivered by the OS (on macOS keyboards these may be produced via Fn+Up/Down). 38 + 39 + - Virtual column tracking 40 + - Add `desired_col` to remember horizontal intent across vertical/page moves; clamp to target line length but preserve for subsequent moves. 41 + 42 + - Viewport & visibility 43 + - Reuse `ensure_visible()`; add helper to compute the page size from `area.h / 7`. 44 + - After any move, ensure caret lies within the viewport and adjust `scroll_line` as needed. 45 + 46 + - Selection mechanics 47 + - Use `ensure_selection_anchor()` for Shift variants; otherwise `clear_selection()`. 48 + - When applying block edits, compute affected line range from selection start/end (convert char indices → line indices) regardless of anchor/caret order. 49 + 50 + - Undo/redo 51 + - Use a single `EditOp` batch per multi-line indent/outdent for ergonomic undo. 52 + 53 + - Key wiring (winit) 54 + - `VirtualKeyCode::PageUp` / `PageDown` (+Shift). 55 + - Ctrl/Cmd+`Home` / Ctrl/Cmd+`End`. 56 + - Tab / Shift+Tab: selection → block indent/outdent; no selection → keep current insert-space behavior. 57 + 58 + ## Out of Scope (Future Phases) 59 + 60 + - Word navigation/delete (Ctrl/Alt+Left/Right, Ctrl+Backspace/Delete). 61 + - Smart Home (toggle first non-whitespace vs col 0). 62 + - Duplicate/delete line; move line up/down. 63 + - Mouse selection (click/drag/double-click word/triple-click line). 64 + - Find/Goto/Bookmarks/Outline/Run shortcuts. 65 + 66 + --- 67 + 68 + Implementation will reference and update this checklist, checking items off as they land with tests.