scoop:scoop.ui:0.1.0
src/text/menu/commands.scoop
Selected production source · src/text/menu/commands.scoop
1
package scoop.ui.text3
import scoop.window.*5
internal fun textMenuSupports(command: TextEditCommand, editing: Boolean): Boolean =6
when (command) {7
case Copy -> true8
case SelectAll -> true9
case Undo -> editing10
case Redo -> editing11
case Cut -> editing12
case Paste -> editing13
case DeleteSelection -> editing14
else -> false15
}17
internal fun textMenuAvailable(value: TextCommandAvailability, command: TextEditCommand): Boolean =18
when (command) {19
case Undo -> value.undo20
case Redo -> value.redo21
case Cut -> value.cut22
case Copy -> value.copy23
case Paste -> value.paste24
case DeleteSelection -> value.deleteSelection25
case SelectAll -> value.selectAll26
else -> false27
}