-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
51 lines (47 loc) · 1.2 KB
/
types.go
File metadata and controls
51 lines (47 loc) · 1.2 KB
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
package main
import "os"
type Region struct {
Logger Logger
windowXA int
windowXB int
windowYA int
windowYB int
xa int
xb int
ya int
yb int
cursorPosition int
fileCoords map[int][2]int
cursorCoords map[[2]int]int
Content string
lineNumBuffer int
}
type Logger struct {
FileName string
}
type TextEditor struct {
Logger
fileContents string
// Position of the cursor within the fileContents
cursorPosition int
commandCursorPosition int
fileName string
fileObject *os.File
pageWidth int
pageHeight int
width int
height int
IN_COMMAND_MODE bool
command string
lineNumBuffer int
currentLine string
x int
y int
characterCoordMap map[int][2]int
reverseCharacterCoordMap map[[2]int]int
// Logically I think combining the line + file regions might be better but
// might also be more effort than it's worth right now
lineRegion *Region
fileRegion *Region
commandRegion *Region
}