Skip to content

Commit 8bdb546

Browse files
committed
refactor(ui): rename view and apply buttons for clarity
1 parent f8019d9 commit 8bdb546

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/SingleFileDiffSketch.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class SingleFileDiffSketch(
7373
})
7474
}
7575

76-
// read content, count add and remove line by '+' and '-' in patch.hunks
7776
val addLine = patch.hunks.sumOf {
7877
it.lines.count { it.type == PatchLine.Type.ADD }
7978
}
@@ -146,7 +145,7 @@ class SingleFileDiffSketch(
146145
// })
147146
// }
148147

149-
val viewDiffButton = JButton("View").apply {
148+
val viewButton = JButton("View").apply {
150149
icon = AllIcons.Actions.ListChanges
151150
toolTipText = AutoDevBundle.message("sketch.patch.action.viewDiff.tooltip")
152151

@@ -157,7 +156,7 @@ class SingleFileDiffSketch(
157156
})
158157
}
159158

160-
val runStreamButton = JButton("Apply").apply {
159+
val applyButton = JButton("Apply").apply {
161160
icon = AllIcons.Actions.RunAll
162161
toolTipText = AutoDevBundle.message("sketch.patch.action.runDiff.tooltip")
163162
isEnabled = appliedPatch?.status == ApplyPatchStatus.SUCCESS
@@ -201,7 +200,7 @@ class SingleFileDiffSketch(
201200
}
202201
}
203202

204-
return listOf(viewDiffButton, runStreamButton, repairButton)
203+
return listOf(viewButton, applyButton, repairButton)
205204
}
206205

207206
override fun getViewText(): String = currentFile.readText()

0 commit comments

Comments
 (0)