Skip to content

Commit 52cab26

Browse files
committed
Fix select all being enabled when the list is empty and an edge is selected
1 parent 8ddd40b commit 52cab26

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
2525
- Fixed an issue where newly placed splicing tables would default to having the first iota selected.
2626
- Fixed several bugs/exploits related to the Splicing Table's media buffer ([#40](https://github.com/object-Object/HexDebug/pull/40), [#41](https://github.com/object-Object/HexDebug/pull/41), [#44](https://github.com/object-Object/HexDebug/pull/44), [#45](https://github.com/object-Object/HexDebug/pull/45)).
2727
- Fixed Lodestone Reflection not working in the Mindsplice Table ([#42](https://github.com/object-Object/HexDebug/pull/42)).
28+
- Fixed a bug in the Splicing Table where the Select All button was enabled when the list was empty and the left edge was selected.
2829

2930
## `0.4.0+1.20.1` - 2025-09-21
3031

Common/src/main/kotlin/gay/object/hexdebug/splicing/SplicingTableAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ enum class SplicingTableAction(val value: Value<*>) {
149149
SELECT_ALL(Value(
150150
ReadList,
151151
consumesMedia = false,
152-
test = { selection, _ -> selection != Selection.range(0, lastIndex) },
153-
validate = { selection != Selection.range(0, list.lastIndex) },
152+
test = { selection, _ -> selection != Selection.range(0, lastIndex) && listSize > 0 },
153+
validate = { selection != Selection.range(0, list.lastIndex) && list.size > 0 },
154154
) {
155155
selection = Selection.range(0, list.lastIndex)
156156
}),

Common/src/main/kotlin/gay/object/hexdebug/splicing/SplicingTableClientView.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ data class SplicingTableClientView(
2626
val isClipboardReadable = null != clipboard // thanks kotlin
2727

2828
val lastIndex = list?.lastIndex ?: -1
29+
val listSize = list?.size ?: 0
2930

3031
fun isInRange(index: Int) = list?.let { index in it.indices } ?: false
3132

0 commit comments

Comments
 (0)