Browse Source

Workaround for selection problem.

pull/405/head
Nikolay Igotti 3 years ago
parent
commit
75e59850e2
  1. 6
      examples/codeviewer/common/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/Editor.kt

6
examples/codeviewer/common/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/Editor.kt

@ -45,8 +45,10 @@ fun Editor(file: File) = Editor(
fun content(index: Int): Editor.Content {
val text = textLines.get(index)
.trim('\r', '\n') // fix for native crash in skia
val state = mutableStateOf(text)
.trim('\n') // fix for native crash in Skia.
// Workaround for another Skia problem with empty line layout.
// TODO: maybe use another symbols, i.e. \u2800 or \u00a0.
val state = mutableStateOf(if (text.isEmpty()) " " else text)
return Editor.Content(state, isCode)
}

Loading…
Cancel
Save