Skip to content

implement embedded in-pane text editor using ratatui-textarea#2

Merged
i1rr merged 1 commit into
masterfrom
claude/add-tests-fix-bugs-QcmvP
Mar 16, 2026
Merged

implement embedded in-pane text editor using ratatui-textarea#2
i1rr merged 1 commit into
masterfrom
claude/add-tests-fix-bugs-QcmvP

Conversation

@i1rr
Copy link
Copy Markdown
Owner

@i1rr i1rr commented Mar 16, 2026

No description provided.

replace the external-editor suspend/resume approach with a live
in-pane editor: pressing Enter on a text file replaces the active
pane slot with an EditorPane while the other pane stays fully
navigable.

architecture:
- PaneContent enum wraps Explorer | Box<EditorPane> so each pane
  slot can hold either a file listing or an open file
- EditorPane wraps ratatui-textarea TextArea<'static> with load,
  save, and key-handling logic
- DualPane gains open_editor_in_active / close_editor_in_active,
  active_editor / active_editor_mut accessors, handle_editor_key
  forwarding, left_dir / right_dir / active_dir / refresh_both helpers
- map_key routes all key events through Action::EditorKeyInput when
  the active pane is an editor, bypassing the normal navigator mapping
- Action::OpenEditor now carries the path; CloseEditor, SaveEditor,
  EditorKeyInput added

editor key bindings:
- Ctrl+S - save to disk
- Ctrl+Q or Esc - close (confirm dialog if modified)
- Tab - switch to other pane
- Ctrl+I - insert literal tab character
- all other keys handled by ratatui-textarea (arrows, undo/redo Ctrl+Z,
  search Ctrl+F, copy/cut/paste, emacs Ctrl+A/E/K/Y, etc.)

status bar shows Ln/Col when editor is active.

dependency: ratatui-textarea = "0.8" (ratatui org fork, ratatui 0.30
native, API-compatible with tui-textarea but modular sub-crate deps).

all 149 tests pass.

https://claude.ai/code/session_01H2u7LG4Er99DFEHw242bNU
@i1rr i1rr merged commit 3180eb0 into master Mar 16, 2026
1 check passed
@i1rr i1rr deleted the claude/add-tests-fix-bugs-QcmvP branch March 16, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants