Scoop API

scoop:scoop.readline:0.1.0

src/config.scoop

Selected production source · src/config.scoop

1package scoop.readline
3/** Selects the built-in key map. */
4public enum EditMode {
5 Emacs, Vi
6}
8/** Selects cycling, common-prefix/list completion, or interactive fuzzy selection. */
9public enum CompletionType {
10 Circular, List, Fuzzy
13/** Selects the feedback used for an unavailable editing operation. */
14public enum BellStyle {
15 Audible, Visible, None
18/** Controls ANSI decoration produced by highlighters. */
19public enum ColorMode {
20 Enabled, Disabled, Forced
23/** Immutable editor options. Indices, counts, and dimensions use Long. */
24public 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 = 500L
40) {
41 init {
42 if (
43 maxHistorySize <
44 0L ||
45 completionPromptLimit <
46 0L ||
47 tabStop <=
48 0L ||
49 indentSize <
50 0L ||
51 keySequenceTimeoutMilliseconds <
52 0L
53 ) {
54 throw IllegalArgumentException(Some("invalid readline configuration"))
55 }
56 }
59/** Signals end of input, including Ctrl-D on an empty buffer. */
60public class ReadlineEofException public constructor(): Exception(Some("end of input"))
62/** Signals Ctrl-C without treating it as an accepted line. */
63public class ReadlineInterruptedException public constructor(): Exception(Some("input interrupted"))