[fleet] move by words should honor folded fragments (AIR-2300)

GitOrigin-RevId: 0671c05241edfda7cb1a4448cf8397cbf1585e75
This commit is contained in:
Dennis Ushakov
2025-10-01 17:07:21 +02:00
committed by intellij-monorepo-bot
parent 9f76822e9d
commit ae43109823
2 changed files with 8 additions and 3 deletions

View File

@@ -151,7 +151,7 @@ interface EditorLayout {
interface MutableEditorLayout : EditorLayout {
fun unfold(affectedFolds: List<Interval<*, Fold>>)
fun toggleFolds(add: List<Interval<*, Fold>>, remove: List<Interval<*, Fold>>, isConfirm: Boolean = false)
fun toggleFolds(add: List<Interval<*, Fold>>, remove: List<Interval<*, Fold>>)
}
// Order is significant: the greater index, the more specific is the command type

View File

@@ -119,9 +119,14 @@ data class SimpleEditorLayout(
)
}
override fun unfold(affectedFolds: List<Interval<*, Fold>>) {}
override fun unfold(affectedFolds: List<Interval<*, Fold>>) {
toggleFolds(emptyList(), affectedFolds)
}
override fun toggleFolds(add: List<Interval<*, Fold>>, remove: List<Interval<*, Fold>>, isConfirm: Boolean) {}
override fun toggleFolds(add: List<Interval<*, Fold>>, remove: List<Interval<*, Fold>>) {
folds = folds.removeByIds(remove.map { it.id as Long }).addIntervals(add as List<Interval<Long, Fold>>)
// we should update lines cache here, but right now simple editor with folds is used only in tests
}
}
class SimpleEditorLayoutComponent(var state: SimpleEditorLayout) : DocumentComponent {