From 70a9331b7becbf3e070b354d887c145e4786c388 Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sun, 29 Jan 2023 22:28:36 +0100 Subject: [PATCH] Add key to the StatusEntries list When clicking around a lot, staging and unstaging some files, it otherwise messed up the association of StatusEntry and file and then didn't do anything when I clicked a certain file, presumably because it thought it was already shown. --- src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt index 323b725..9e4759b 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt @@ -581,7 +581,7 @@ private fun EntriesList( .background(MaterialTheme.colors.background), state = lazyListState, ) { - items(statusEntries) { statusEntry -> + items(statusEntries, key = { it.filePath }) { statusEntry -> val isEntrySelected = selectedEntryType != null && selectedEntryType is DiffEntryType.UncommitedDiff && // Added for smartcast selectedEntryType.statusEntry == statusEntry