scoop:scoop.readline:0.1.0
src/config.scoop
Selected production source · src/config.scoop
1
package scoop.readline3
/** Selects the built-in key map. */4
public enum EditMode {5
Emacs, Vi6
}8
/** Selects cycling, common-prefix/list completion, or interactive fuzzy selection. */9
public enum CompletionType {10
Circular, List, Fuzzy11
}13
/** Selects the feedback used for an unavailable editing operation. */14
public enum BellStyle {15
Audible, Visible, None16
}18
/** Controls ANSI decoration produced by highlighters. */19
public enum ColorMode {20
Enabled, Disabled, Forced21
}23
/** Immutable editor options. Indices, counts, and dimensions use Long. */24
public class Config internal constructor(25
public val editMode: EditMode = EditMode.Emacs,26
public val maxHistorySize: Long = 100L,27
public val historyIgnoreDuplicates: Boolean = true,28
public val historyIgnoreSpace: Boolean = false,29
public val historyCaseSensitive: Boolean = true,30
public val autoAddHistory: Boolean = false,31
public val completionType: CompletionType = CompletionType.Circular,32
public val completionPromptLimit: Long = 100L,33
public val completionShowAllIfAmbiguous: Boolean = false,34
public val bellStyle: BellStyle = BellStyle.Audible,35
public val colorMode: ColorMode = ColorMode.Enabled,36
public val tabStop: Long = 8L,37
public val indentSize: Long = 2L,38
public val bracketedPaste: Boolean = true,39
public val keySequenceTimeoutMilliseconds: Long = 500L40
) {41
init {42
if (43
maxHistorySize <44
0L ||45
completionPromptLimit <46
0L ||47
tabStop <=48
0L ||49
indentSize <50
0L ||51
keySequenceTimeoutMilliseconds <52
0L53
) {54
throw IllegalArgumentException(Some("invalid readline configuration"))55
}56
}57
}59
/** Signals end of input, including Ctrl-D on an empty buffer. */60
public class ReadlineEofException public constructor(): Exception(Some("end of input"))62
/** Signals Ctrl-C without treating it as an accepted line. */63
public class ReadlineInterruptedException public constructor(): Exception(Some("input interrupted"))