scoop:scoop.readline:0.1.0
src/config_builder.scoop
Selected production source · src/config_builder.scoop
1
package scoop.readline3
/** Configures one complete value; execution remains explicit. */4
public fun readlineConfig(configure: ConfigBuilder.() -> Unit = {}): Config {5
val builder = ConfigBuilder()6
builder.configure()7
return builder.snapshot()8
}10
public fun Config.copy(configure: ConfigBuilder.() -> Unit = {}): Config {11
val builder = ConfigBuilder()12
builder.editMode = this.editMode13
builder.maxHistorySize = this.maxHistorySize14
builder.historyIgnoreDuplicates = this.historyIgnoreDuplicates15
builder.historyIgnoreSpace = this.historyIgnoreSpace16
builder.historyCaseSensitive = this.historyCaseSensitive17
builder.autoAddHistory = this.autoAddHistory18
builder.completionType = this.completionType19
builder.completionPromptLimit = this.completionPromptLimit20
builder.completionShowAllIfAmbiguous = this.completionShowAllIfAmbiguous21
builder.bellStyle = this.bellStyle22
builder.colorMode = this.colorMode23
builder.tabStop = this.tabStop24
builder.indentSize = this.indentSize25
builder.bracketedPaste = this.bracketedPaste26
builder.keySequenceTimeoutMilliseconds = this.keySequenceTimeoutMilliseconds27
builder.configure()28
return builder.snapshot()29
}31
public class ConfigBuilder internal constructor() {32
public var editMode: EditMode = EditMode.Emacs33
public var maxHistorySize: Long = 100L34
public var historyIgnoreDuplicates: Boolean = true35
public var historyIgnoreSpace: Boolean = false36
public var historyCaseSensitive: Boolean = true37
public var autoAddHistory: Boolean = false38
public var completionType: CompletionType = CompletionType.Circular39
public var completionPromptLimit: Long = 100L40
public var completionShowAllIfAmbiguous: Boolean = false41
public var bellStyle: BellStyle = BellStyle.Audible42
public var colorMode: ColorMode = ColorMode.Enabled43
public var tabStop: Long = 8L44
public var indentSize: Long = 2L45
public var bracketedPaste: Boolean = true46
public var keySequenceTimeoutMilliseconds: Long = 500L47
internal fun snapshot(): Config =48
Config(49
editMode,50
maxHistorySize,51
historyIgnoreDuplicates,52
historyIgnoreSpace,53
historyCaseSensitive,54
autoAddHistory,55
completionType,56
completionPromptLimit,57
completionShowAllIfAmbiguous,58
bellStyle,59
colorMode,60
tabStop,61
indentSize,62
bracketedPaste,63
keySequenceTimeoutMilliseconds64
)65
}