Added trimStart for commit message

Fixes #89
This commit is contained in:
Abdelilah El Aissaoui 2023-02-23 13:10:49 +01:00
parent c1919c08a0
commit e75af0938f
No known key found for this signature in database
GPG Key ID: 7587FC860F594869
2 changed files with 14 additions and 2 deletions

View File

@ -9,3 +9,10 @@ fun RevCommit.fullData(repository: Repository): RevCommit? {
else else
this this
} }
fun RevCommit.getShortMessageTrimmed(): String {
return (this.fullMessage ?: "")
.trimStart()
.replace("\r\n", "\n")
.takeWhile { it != '\n' }
}

View File

@ -884,8 +884,13 @@ fun CommitMessage(
} }
} }
} }
val message = remember(commit.id.name) {
commit.getShortMessageTrimmed()
}
Text( Text(
text = commit.shortMessage, text = message,
modifier = Modifier modifier = Modifier
.padding(start = 8.dp) .padding(start = 8.dp)
.weight(1f), .weight(1f),