Fixed diff lines being cut
This commit is contained in:
parent
b950dc13fc
commit
ef384007d3
@ -30,6 +30,10 @@ val String.dirPath: String
|
|||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun String.removeLineEndings(): String {
|
||||||
|
return this.removeSuffix("\n")
|
||||||
|
.removeSuffix("\r\n")
|
||||||
|
}
|
||||||
|
|
||||||
val String.lineDelimiter: String?
|
val String.lineDelimiter: String?
|
||||||
get() {
|
get() {
|
||||||
|
@ -33,6 +33,7 @@ import androidx.compose.ui.text.font.FontFamily
|
|||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import app.extensions.removeLineEndings
|
||||||
import app.extensions.toStringWithSpaces
|
import app.extensions.toStringWithSpaces
|
||||||
import app.git.DiffEntryType
|
import app.git.DiffEntryType
|
||||||
import app.git.EntryContent
|
import app.git.EntryContent
|
||||||
@ -435,14 +436,13 @@ fun DiffLine(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = line.text.replace(
|
text = line.text.replace( // TODO this replace is a workaround until this issue gets fixed https://github.com/JetBrains/compose-jb/issues/615
|
||||||
"\t",
|
"\t",
|
||||||
" "
|
" "
|
||||||
), // TODO this replace is a workaround until this issue gets fixed https://github.com/JetBrains/compose-jb/issues/615
|
).removeLineEndings(),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(start = 8.dp)
|
.padding(start = 8.dp)
|
||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
maxLines = 1,
|
|
||||||
fontFamily = FontFamily.Monospace,
|
fontFamily = FontFamily.Monospace,
|
||||||
style = MaterialTheme.typography.body2,
|
style = MaterialTheme.typography.body2,
|
||||||
overflow = TextOverflow.Visible,
|
overflow = TextOverflow.Visible,
|
||||||
|
Loading…
Reference in New Issue
Block a user