nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] Two pastes placed back to back merge their text with no separator

Open addyCooks opened this issue 2 months ago • 1 comments

Description

formatPasteDisplayText appends the paste placeholder with no delimiter. When two multi-line pastes land back to back, the last line of the first and the first line of the second fuse into a single token in the text actually sent to the model even though the composer's placeholders look completely normal.

Parent: #907

Steps to Reproduce

  1. Paste a multi-line block ending in some distinctive text (e.g. a line reading AAA).
  2. Immediately paste a second multi-line block starting with distinctive text (e.g. a line reading BBB).
  3. Submit, and inspect the actual message content sent to the model.

Expected Behavior

The two pastes stay clearly separated at minimum a newline between them.

Actual Behavior

The UI shows two clean, separate placeholders ([Paste #1: 29 chars][Paste #2: 29 chars]) looks completely fine. But the assembled message text is ...AAABBB... the boundary between the two pastes is silently fused.

Recording

Image

Root Cause

source/utils/paste-utils.ts:79-81 appends the placeholder to the display value with no delimiter when the preceding text doesn't already end in whitespace.

Suggested Fix

Insert a newline between pasted segments when the display value doesn't already end in whitespace.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs on the latest main

addyCooks avatar Sep 17 '26 18:09 addyCooks

Hey @akramcodez,
I’m interested in taking this one up could you assign this to me ?

addyCooks avatar Sep 17 '26 18:09 addyCooks