Skip to content

Fixed pasting indent issue - #24

Merged
CharOfString merged 3 commits into
mainfrom
char/editor_buffer
Oct 16, 2026
Merged

CharOfString merged 3 commits into
mainfrom
char/editor_buffer

Conversation

@CharOfString

Copy link
Copy Markdown
Owner

This merge request closes issue (GitHub) #23.

This merge request contains following update(s):

  • Fixed pasting indent issue.

CharOfString and others added 3 commits September 30, 2026 10:15
This is a regular merge before reusing the branch.
No issue closed, no merge request related.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CharOfString
CharOfString requested a balanced review from Copilot October 16, 2026 06:09
@CharOfString CharOfString self-assigned this Oct 16, 2026
@CharOfString CharOfString added the bug Something isn't working label Oct 16, 2026
@CharOfString CharOfString linked an issue Oct 16, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Terminal pastes can deadlock the editor, and input-state handling can corrupt pasted text or misroute subsequent keys.

3 open findings
What changed in this PR

Addresses issue #23 by handling terminal pastes as complete text blocks to preserve editor indentation.

Changes:

  • Enables bracketed paste and routes pasted text to the editor, prompts, or terminal.
  • Adds single-edit insertion, newline normalization, and animated scrolling.
  • Adds tests for paste behavior and scrolling.
File Description
src/​main.rs Enables and disables bracketed paste.
src/​buffers/​terminal.rs Adds terminal paste forwarding and shared prompt detection.
src/​buffers/​search/​mod.rs Exposes active search state for paste routing.
src/​buffers/​render.rs Applies temporary scroll offsets during rendering.
src/​buffers/​paste.rs Implements paste routing, insertion, scrolling, and tests.
src/​buffers/​mod.rs Registers the paste module.
src/​app.rs Handles paste events and animation polling.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/buffers/terminal.rs
Comment on lines +164 to +167
if session.parser.screen().bracketed_paste() {
self.write(format!("\x1b[200~{text}\x1b[201~").as_bytes())
} else {
self.write(text.as_bytes())
Comment thread src/buffers/paste.rs
Comment on lines +42 to +43
if self.terminal.focused && !self.prompt_open() {
if let Err(err) = self.terminal.paste(&text) {
Comment thread src/buffers/paste.rs

// Prompts, the menu and key chords read single keys, so type the text into them.
// Line breaks and other control characters are left out.
if self.keys_go_elsewhere() {
@CharOfString
CharOfString merged commit bfe7546 into main Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Indent issue while pasting

2 participants