diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/extensions/RevCommitExtensions.kt b/src/main/kotlin/com/jetpackduba/gitnuro/extensions/RevCommitExtensions.kt index 7d2d3d0..b262a56 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/extensions/RevCommitExtensions.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/extensions/RevCommitExtensions.kt @@ -8,4 +8,11 @@ fun RevCommit.fullData(repository: Repository): RevCommit? { repository.parseCommit(this) else this -} \ No newline at end of file +} + +fun RevCommit.getShortMessageTrimmed(): String { + return (this.fullMessage ?: "") + .trimStart() + .replace("\r\n", "\n") + .takeWhile { it != '\n' } +} diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt index 3e4fdb8..51f98c6 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt @@ -884,8 +884,13 @@ fun CommitMessage( } } } + + val message = remember(commit.id.name) { + commit.getShortMessageTrimmed() + } + Text( - text = commit.shortMessage, + text = message, modifier = Modifier .padding(start = 8.dp) .weight(1f),