Skip to content

Commit e4e82e3

Browse files
committed
fix(editor): adjust resize logic for EditorFragment
1 parent 255870a commit e4e82e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/EditorFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ class EditorFragment(var editor: EditorEx, private val editorLineThreshold: Int
104104
}
105105

106106
fun resizeForNewThreshold(newThreshold: Int) {
107-
content.preferredSize = calculatePreferredSize(content.preferredSize, newThreshold)
107+
setCollapsed(false)
108108

109-
setCollapsed(true)
109+
content.preferredSize = calculatePreferredSize(content.preferredSize, newThreshold)
110110

111111
val linesCount = editor.document.lineCount
112112
expandCollapseTextLabel.isVisible = linesCount > editorLineThreshold

0 commit comments

Comments
 (0)