-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathstate.go
45 lines (41 loc) · 917 Bytes
/
state.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
package state
import (
"github.com/itchyny/bed/layout"
"github.com/itchyny/bed/mode"
)
// State holds the state of the editor to display the user interface.
type State struct {
Mode mode.Mode
PrevMode mode.Mode
WindowStates map[int]*WindowState
Layout layout.Layout
Cmdline []rune
CmdlineCursor int
CompletionResults []string
CompletionIndex int
SearchMode rune
Error error
ErrorType int
}
// WindowState holds the state of one window.
type WindowState struct {
Name string
Modified bool
Width int
Offset int64
Cursor int64
Bytes []byte
Size int
Length int64
Mode mode.Mode
Pending bool
PendingByte byte
VisualStart int64
EditedIndices []int64
FocusText bool
}
// Message types
const (
MessageInfo = iota
MessageError
)