-
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathcommands.go
209 lines (194 loc) · 3.28 KB
/
commands.go
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package commands
type Command uint8
const (
Noop Command = iota
// Views
SwitchToEditorView
SwitchToConnectionsView
HelpPopup
// Movement: Basic
MoveUp
MoveDown
MoveLeft
MoveRight
// Movement: Jumps
GotoNext
GotoPrev
GotoStart
GotoEnd
GotoTop
GotoBottom
// Movement: Page
PageNext
PagePrev
// Menu:
RecordsMenu
ColumnsMenu
ConstraintsMenu
ForeignKeysMenu
IndexesMenu
// Tabs
TabNext
TabPrev
TabFirst
TabLast
TabClose
// Operations
Refresh
UnfocusEditor
Copy
Edit
CommitEdit
DiscardEdit
Save
Delete
Search
SearchGlobal
Quit
Execute
OpenInExternalEditor
AppendNewRow
SortAsc
SortDesc
UnfocusTreeFilter
CommitTreeFilter
NextFoundNode
PreviousFoundNode
TreeCollapseAll
ExpandAll
SetValue
FocusSidebar
UnfocusSidebar
ToggleSidebar
// Connection
NewConnection
Connect
TestConnection
EditConnection
DeleteConnection
)
func (c Command) String() string {
switch c {
case Noop:
return "Noop"
// Views
case SwitchToEditorView:
return "SwitchToEditorView"
case SwitchToConnectionsView:
return "SwitchToConnectionsView"
case HelpPopup:
return "HelpPopup"
// Movement: Basic
case MoveUp:
return "MoveUp"
case MoveDown:
return "MoveDown"
case MoveLeft:
return "MoveRight"
case MoveRight:
return "MoveRight"
// Movement: Jumps
case GotoNext:
return "GotoNext"
case GotoPrev:
return "GotoPrev"
case GotoStart:
return "GotoStart"
case GotoEnd:
return "GotoEnd"
case GotoTop:
return "GotoTop"
case GotoBottom:
return "GotoBottom"
// Movement: Page
case PageNext:
return "PageNext"
case PagePrev:
return "PagePrev"
// Tabs
case TabNext:
return "TabNext"
case TabPrev:
return "TabPrev"
case TabFirst:
return "TabFirst"
case TabLast:
return "TabLast"
case TabClose:
return "TabClose"
// Operations
case Copy:
return "Copy"
case Edit:
return "Edit"
case Save:
return "Save"
case Delete:
return "Delete"
case Search:
return "Search"
case SearchGlobal:
return "SearchGlobal"
case Quit:
return "Quit"
case Execute:
return "Execute"
case OpenInExternalEditor:
return "OpenInExternalEditor"
case AppendNewRow:
return "AppendNewRow"
case SortAsc:
return "SortAsc"
case SortDesc:
return "SortDesc"
case NewConnection:
return "NewConnection"
case Connect:
return "Connect"
case TestConnection:
return "TestConnection"
case EditConnection:
return "EditConnection"
case DeleteConnection:
return "DeleteConnection"
case Refresh:
return "Refresh"
case UnfocusEditor:
return "UnfocusEditor"
case RecordsMenu:
return "RecordsMenu"
case ColumnsMenu:
return "ColumnsMenu"
case ConstraintsMenu:
return "ConstraintsMenu"
case ForeignKeysMenu:
return "ForeignKeysMenu"
case IndexesMenu:
return "IndexesMenu"
case UnfocusTreeFilter:
return "UnfocusTreeFilter"
case CommitTreeFilter:
return "CommitTreeFilter"
case NextFoundNode:
return "NextFoundNode"
case PreviousFoundNode:
return "PreviousFoundNode"
case TreeCollapseAll:
return "TreeCollapseAll"
case ExpandAll:
return "ExpandAll"
case SetValue:
return "SetValue"
case FocusSidebar:
return "FocusSidebar"
case ToggleSidebar:
return "ToggleSidebar"
case UnfocusSidebar:
return "UnfocusSidebar"
case CommitEdit:
return "CommitEdit"
case DiscardEdit:
return "DiscardEdit"
}
return "Unknown"
}