Repository navigation
Fixed pasting indent issue - #24
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟡 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 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 on lines
+42
to
+43
| if self.terminal.focused && !self.prompt_open() { | ||
| if let Err(err) = self.terminal.paste(&text) { |
|
|
||
| // 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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This merge request closes issue (GitHub) #23.
This merge request contains following update(s):