turbo-editors/turbo-corepublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-core.git
git clone ssh://git@rickub.com/turbo-editors/turbo-core.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

🛟 Updated. 28d5985 · on main · k33g · 4h ago
keys.go · 122 lines · 4.7 KBGo Blame HistoryRaw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Package theme turns TOML colour files into the tcell styles the editor
// draws with.
//
// A theme is a flat map from a dotted style key, such as "syntax.keyword", to
// a foreground colour, a background colour and a few attributes. Lookups fall
// back along the dots, so a theme that only defines "syntax" still colours
// every token, and one that defines nothing still renders.
//
// Themes ship embedded in the binary and are also read from the user's
// configuration directory, where a file of the same name wins.
package theme

// The style keys the editor asks for. A theme need not define them all:
// Style falls back along the dots and finally onto KeyDefault, so a partial
// theme is a usable theme.
//
// Keys are grouped by the widget that draws with them. Adding a widget means
// adding its keys here, so that this list stays the single description of what
// a theme file may contain.
const (
	// KeyDefault is the last resort of every lookup.
	KeyDefault = "default"

	// The desktop is the patterned backdrop behind every window.
	KeyDesktop = "desktop"
	// KeyShadow is the dimmed cells a window casts to its bottom right.
	KeyShadow = "shadow"

	KeyMenuBar      = "menu.bar"
	KeyMenuItem     = "menu.item"
	KeyMenuSelected = "menu.selected"
	KeyMenuShortcut = "menu.shortcut"
	KeyMenuDisabled = "menu.disabled"

	KeyWindowFrameActive   = "window.frame.active"
	KeyWindowFrameInactive = "window.frame.inactive"
	KeyWindowTitleActive   = "window.title.active"
	KeyWindowTitleInactive = "window.title.inactive"
	KeyWindowBody          = "window.body"

	KeyStatusBar      = "statusbar"
	KeyStatusBarKey   = "statusbar.key"
	KeyStatusBarHint  = "statusbar.hint"
	KeyScrollBar      = "scrollbar"
	KeyScrollBarThumb = "scrollbar.thumb"

	KeyDialogFrame = "dialog.frame"
	KeyDialogBody  = "dialog.body"
	KeyDialogTitle = "dialog.title"
	KeyDialogLabel = "dialog.label"

	KeyButton          = "button"
	KeyButtonFocused   = "button.focused"
	KeyButtonShortcut  = "button.shortcut"
	KeyInput           = "input"
	KeyInputFocused    = "input.focused"
	KeyInputSelection  = "input.selection"
	KeyList            = "list"
	KeyListSelected    = "list.selected"
	KeyListUnfocused   = "list.unfocused"
	KeyCheckbox        = "checkbox"
	KeyCheckboxFocused = "checkbox.focused"

	KeyEditorText       = "editor.text"
	KeyEditorSelection  = "editor.selection"
	KeyEditorLineNumber = "editor.linenumber"
	KeyEditorCurrent    = "editor.currentline"
	// KeyEditorCursor colours the cell the cursor is on. It must contrast with
	// editor.currentline whichever way round the terminal draws its own cursor.
	KeyEditorCursor = "editor.cursor"

	// KeyTerminalText is the default colour of a terminal window's contents,
	// used wherever the program running in it has asked for none of its own.
	KeyTerminalText = "terminal.text"
	// KeyTerminalCursor colours the cell the shell's cursor is on.
	KeyTerminalCursor = "terminal.cursor"

	// KeyTreeText is a file's name in a project tree, and the tree's own
	// background.
	KeyTreeText = "tree.text"
	// KeyTreeDirectory is a directory's name, which wants to stand out from
	// the files beside it.
	KeyTreeDirectory = "tree.directory"
	// KeyTreeSelected is the highlighted row of a focused tree. It cannot be
	// borrowed from the list group: a dialog's list sits on a dialog, and
	// list.selected is coloured to stand out against that rather than against
	// a window's body.
	KeyTreeSelected = "tree.selected"
	// KeyTreeUnfocused is the highlighted row of a tree that does not have the
	// keyboard, so a screenful of windows still says where typing would go.
	KeyTreeUnfocused = "tree.unfocused"

	KeySyntaxKeyword     = "syntax.keyword"
	KeySyntaxType        = "syntax.type"
	KeySyntaxBuiltin     = "syntax.builtin"
	KeySyntaxConstant    = "syntax.constant"
	KeySyntaxFunction    = "syntax.function"
	KeySyntaxString      = "syntax.string"
	KeySyntaxChar        = "syntax.char"
	KeySyntaxNumber      = "syntax.number"
	KeySyntaxComment     = "syntax.comment"
	KeySyntaxOperator    = "syntax.operator"
	KeySyntaxPunctuation = "syntax.punctuation"
	KeySyntaxIdentifier  = "syntax.identifier"

	// The classes that only the markup languages produce. Go has nothing that
	// reads as a heading or a tag, so these appear in Markdown and HTML only.
	KeySyntaxHeading   = "syntax.heading"
	KeySyntaxTag       = "syntax.tag"
	KeySyntaxAttribute = "syntax.attribute"
	KeySyntaxEmphasis  = "syntax.emphasis"
	KeySyntaxLink      = "syntax.link"

	KeyCompletionFrame    = "completion.frame"
	KeyCompletionItem     = "completion.item"
	KeyCompletionSelected = "completion.selected"
	KeyCompletionDetail   = "completion.detail"

	KeyDiagnosticError   = "diagnostic.error"
	KeyDiagnosticWarning = "diagnostic.warning"
	KeyDiagnosticInfo    = "diagnostic.info"
)