diff --git a/fleet/andel/srcCommonMain/andel/editor/MutableEditor.kt b/fleet/andel/srcCommonMain/andel/editor/MutableEditor.kt index f21af0d678e2..dcc4dec7db74 100644 --- a/fleet/andel/srcCommonMain/andel/editor/MutableEditor.kt +++ b/fleet/andel/srcCommonMain/andel/editor/MutableEditor.kt @@ -151,7 +151,7 @@ interface EditorLayout { interface MutableEditorLayout : EditorLayout { fun unfold(affectedFolds: List>) - fun toggleFolds(add: List>, remove: List>, isConfirm: Boolean = false) + fun toggleFolds(add: List>, remove: List>) } // Order is significant: the greater index, the more specific is the command type diff --git a/fleet/andel/srcCommonMain/andel/editor/SimpleEditor.kt b/fleet/andel/srcCommonMain/andel/editor/SimpleEditor.kt index 7ce50dc12122..2704bf075e38 100644 --- a/fleet/andel/srcCommonMain/andel/editor/SimpleEditor.kt +++ b/fleet/andel/srcCommonMain/andel/editor/SimpleEditor.kt @@ -119,9 +119,14 @@ data class SimpleEditorLayout( ) } - override fun unfold(affectedFolds: List>) {} + override fun unfold(affectedFolds: List>) { + toggleFolds(emptyList(), affectedFolds) + } - override fun toggleFolds(add: List>, remove: List>, isConfirm: Boolean) {} + override fun toggleFolds(add: List>, remove: List>) { + folds = folds.removeByIds(remove.map { it.id as Long }).addIntervals(add as List>) + // we should update lines cache here, but right now simple editor with folds is used only in tests + } } class SimpleEditorLayoutComponent(var state: SimpleEditorLayout) : DocumentComponent {