Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [2026.1.3]

### Fixes

- Fixed [Clicking gutter -> "Rollback Lines" loses newline](https://github.com/comod/git-scope-pro/issues/94)

## [2026.1.2]

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pluginGroup=org.woelkit.plugins
pluginName=Git Scope
pluginRepositoryUrl=https://github.com/comod/git-scope-pro
pluginVersion=2026.1.2
pluginVersion=2026.1.3
pluginSinceBuild=243

platformType=IU
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/implementation/gutter/ScopeGutterPopupPanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -501,16 +501,22 @@ internal class ScopeGutterPopupPanel(
val baseContent = diffViewer.getVcsContentForRange(range, includeContext = false)
LOG.debug("Restoring deleted content: ${baseContent.length} chars")
if (baseContent.isNotEmpty()) {
val offset = editor.logicalPositionToOffset(LogicalPosition(range.line1, 0))
document.insertString(offset, baseContent + "\n")
if (range.line1 >= document.lineCount) {
// Inserting at end of document: prepend newline separator
document.insertString(document.textLength, "\n" + baseContent)
} else {
// Inserting before an existing line: append newline to push it down
val offset = document.getLineStartOffset(range.line1)
document.insertString(offset, baseContent + "\n")
}
}
}
Range.MODIFIED -> {
// For modified lines, replace with base content (without context)
val baseContent = diffViewer.getVcsContentForRange(range, includeContext = false)
LOG.debug("Replacing modified content: ${baseContent.length} chars")
val startOffset = editor.logicalPositionToOffset(LogicalPosition(range.line1, 0))
val endOffset = editor.logicalPositionToOffset(LogicalPosition(range.line2, 0))
val startOffset = document.getLineStartOffset(range.line1)
val endOffset = document.getLineEndOffset(range.line2 - 1)
document.replaceString(startOffset, endOffset, baseContent)
}
}
Expand Down