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

@ -8,4 +8,11 @@ fun RevCommit.fullData(repository: Repository): RevCommit? {
repository.parseCommit(this)
else
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 = commit.shortMessage,
text = message,
modifier = Modifier
.padding(start = 8.dp)
.weight(1f),