@@ -62,18 +62,14 @@ fun KodeEditor(
6262
6363 Box (modifier = Modifier
6464 .clipToBounds()
65- .then(modifier)
66- ) {
65+ .then(modifier)) {
6766 var lineNumberWidth by remember {
6867 mutableIntStateOf(0 )
6968 }
7069 LineNumbers (
7170 modifier = Modifier
7271 .zIndex(1f )
73- .wrapContentSize(
74- align = Alignment .TopStart ,
75- unbounded = true
76- )
72+ .wrapContentSize(align = Alignment .TopStart , unbounded = true )
7773 .onGloballyPositioned {
7874 lineNumberWidth = it.size.width
7975 }
@@ -111,11 +107,6 @@ fun KodeEditor(
111107 offset = offset,
112108 zoom = zoom,
113109 onOffsetChanged = {
114- // val newOffset = Offset(
115- // x = (offset + it).x.coerceIn(0f, (size.width.toFloat() - (configuration.screenWidthDp.dp.toPx() / newScale)).coerceAtLeast(0f)),
116- // y = (offset + it).y.coerceIn(0f, (size.height.toFloat() - (configuration.screenHeightDp.dp.toPx() / newScale)).coerceAtLeast(0f)),
117- // )
118-
119110 val newOffset = offset + (it / zoom)
120111 offset = newOffset.copy(
121112 x = newOffset.x.coerceIn(0f , maxXOffset),
@@ -129,16 +120,10 @@ fun KodeEditor(
129120 KodeTextField (
130121 modifier = Modifier
131122 .align(Alignment .TopStart )
132- .wrapContentSize(
133- align = Alignment .TopStart ,
134- unbounded = true
135- )
123+ .wrapContentSize(align = Alignment .TopStart , unbounded = true )
136124 .matchParentSize()
137125 .background(colors.textFieldBackgroundColor().value)
138- .padding(
139- start = 4 .dp,
140- end = 4 .dp
141- )
126+ .padding(start = 4 .dp, end = 4 .dp)
142127 .onSizeChanged { unboundedSize ->
143128 maxXOffset = (unboundedSize.width - totalSize.width).toFloat()
144129 maxYOffset = (unboundedSize.height - totalSize.height).toFloat()
@@ -166,9 +151,7 @@ private data class DummyData(
166151 },
167152
168153 val dummyRuleBook : LanguageRuleBook = object : LanguageRuleBook {
169- override fun getRules() = listOf(
170- headingRule
171- )
154+ override fun getRules() = listOf(headingRule)
172155 },
173156
174157 val colorScheme : ColorScheme <SpanStyle > = object : ColorScheme <SpanStyle > {
@@ -202,9 +185,7 @@ private fun KodeEditorPreview() {
202185 This is a code block.
203186 ```
204187 """ .trimIndent()
205- mutableStateOf(TextFieldValue (
206- text = initialText
207- ))
188+ mutableStateOf(TextFieldValue (text = initialText))
208189 }
209190
210191 val languageRuleBook by remember {
0 commit comments