[PR #1777] [MERGED] Issue 1676: Don't eat up the last newline in a multi-line replacement #10062

Closed
opened 2026-02-16 18:14:38 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1777
Author: @cvzakharchenko
Created: 8/10/2025
Status: Merged
Merged: 8/11/2025
Merged by: @adamdotdevin

Base: devHead: fix/issue1676-removed-newline


📝 Commits (2)

  • 66738dc Don't eat up the last newline in a multi-line replacement
  • 050eaf8 Off by one

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 packages/opencode/src/tool/edit.ts (+4 -1)

📄 Description

https://github.com/sst/opencode/issues/1676

Similar to a check in BlockAnchorReplacer, the LineTrimmedReplacer shouldn't match the last newline, so it doesn't get replaced


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1777 **Author:** [@cvzakharchenko](https://github.com/cvzakharchenko) **Created:** 8/10/2025 **Status:** ✅ Merged **Merged:** 8/11/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `fix/issue1676-removed-newline` --- ### 📝 Commits (2) - [`66738dc`](https://github.com/anomalyco/opencode/commit/66738dcb6aeedba32e625b25ed291e409633e749) Don't eat up the last newline in a multi-line replacement - [`050eaf8`](https://github.com/anomalyco/opencode/commit/050eaf8858abe8f89d6248d07ad84afb0eeb3d8a) Off by one ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/tool/edit.ts` (+4 -1) </details> ### 📄 Description https://github.com/sst/opencode/issues/1676 Similar to a check in BlockAnchorReplacer, the LineTrimmedReplacer shouldn't match the last newline, so it doesn't get replaced --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:38 -05:00
yindo closed this issue 2026-02-16 18:14:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10062