mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-17 06:34:04 +02:00
25 lines
650 B
Kotlin
25 lines
650 B
Kotlin
package com.maddyhome.idea.vim.vimscript.model
|
|
|
|
import com.intellij.openapi.actionSystem.DataContext
|
|
import com.intellij.openapi.editor.Editor
|
|
|
|
data class Script(val units: List<Executable>) : Executable {
|
|
|
|
override fun execute(
|
|
editor: Editor?,
|
|
context: DataContext?,
|
|
vimContext: VimContext,
|
|
skipHistory: Boolean,
|
|
): ExecutionResult {
|
|
var latestResult: ExecutionResult = ExecutionResult.Success
|
|
for (unit in units) {
|
|
if (latestResult is ExecutionResult.Success) {
|
|
latestResult = unit.execute(editor, context, vimContext, skipHistory)
|
|
} else {
|
|
break
|
|
}
|
|
}
|
|
return latestResult
|
|
}
|
|
}
|