inline-editor

Featured

Inline text editing implementation within the file browser preview pane using tmux PTY backend, cursor movement, text manipulation, and editor state management. Covers entry/exit lifecycle, dimension calculations, confirmation dialogs, click-away detection, mouse forwarding, and app-level key routing. Use when working on inline editing features, text input components, or debugging editor rendering/input issues in the file browser plugin.

Code & Development 1,041 stars 80 forks Updated today MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Inline Editor Implementation ## Overview The inline editor (`tmux_inline_edit`) lets users edit files directly within the file browser preview pane using their preferred terminal editor (vim, nvim, nano, etc.) without leaving the TUI. The file tree remains visible during editing. **Core Principle**: This is NOT a terminal emulator. Tmux manages the PTY backend; Sidecar acts as an input/output relay, similar to the workspace plugin's interactive mode. ## Architecture ### Components 1. **Entry Layer** (`internal/plugins/filebrowser/inline_edit.go`): Creates tmux sessions, manages editor lifecycle 2. **Rendering Layer** (`internal/plugins/filebrowser/view.go`, `inline_edit.go`): Renders editor content within preview pane 3. **Input Layer** (`internal/plugins/filebrowser/plugin.go`, `mouse.go`): Routes keys/clicks to editor or confirmation dialog 4. **TTY Model** (`internal/tty/tty.go`): Handles tmux capture, cursor overlay, and input forwarding ### Data Flow ``` User presses 'e' on file -> enterInlineEditMode() -> tmux new-session -d -s {sessionName} {editor} {path} -> InlineEditStartedMsg -> handleInlineEditStarted() -> tty.Model.Enter() -> Start polling tmux capture-pane -> renderInlineEditorContent() in preview pane -> User types -> tty.Model forwards to tmux -> User exits -> SessionDeadMsg or exit keys -> exitInlineEditMode() -> Refresh preview ``` ## Key Files | File | Purpose | |------|---------| | `internal/plugins/filebrowser/inline_edit...

Details

Author
marcus
Repository
marcus/sidecar
Created
7 months ago
Last Updated
today
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category