From 45629528f230e18e42f54162e3ba6e1eee4b27ee Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sun, 18 Aug 2024 20:44:59 +0200 Subject: [PATCH] Removed option to stage/unstage lines in other than modified files --- src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt index 54ae8cb..dd0a78d 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt @@ -1145,7 +1145,12 @@ fun DiffLineText(line: Line, diffType: DiffType, onActionTriggered: () -> Unit) val isHovered by hoverInteraction.collectIsHoveredAsState() Box(modifier = Modifier.hoverable(hoverInteraction)) { - if (isHovered && diffType is DiffType.UncommittedDiff && line.lineType != LineType.CONTEXT) { + if ( + isHovered && + diffType is DiffType.UncommittedDiff && + line.lineType != LineType.CONTEXT && + diffType.statusType == StatusType.MODIFIED + ) { val color: Color = if (diffType is DiffType.StagedDiff) { MaterialTheme.colors.error } else {