This commit is contained in:
parent
a1f62aa8cb
commit
e2f35f5e7d
@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type document struct {
|
||||
dirty bool
|
||||
filename string
|
||||
rows []*row
|
||||
}
|
||||
@ -15,6 +16,7 @@ func newDocument() *document {
|
||||
var rows []*row
|
||||
|
||||
return &document{
|
||||
false,
|
||||
"",
|
||||
rows,
|
||||
}
|
||||
@ -41,7 +43,7 @@ func (d *document) save() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
file, err := os.OpenFile(d.filename, os.O_RDWR | os.O_CREATE, 0644)
|
||||
file, err := os.OpenFile(d.filename, os.O_RDWR|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
panic("failed to open/create file for saving")
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ type moveCursor struct {
|
||||
}
|
||||
|
||||
var cursorTests = []moveCursor{
|
||||
{[]string{"\x1b"}, false, &point{0,0}},
|
||||
{[]string{keyRight}, true, &point{1,0}},
|
||||
{[]string{"\x1b"}, false, &point{0, 0}},
|
||||
{[]string{keyRight}, true, &point{1, 0}},
|
||||
{[]string{keyEnd}, true, &point{14, 0}},
|
||||
{[]string{keyEnd, keyHome}, true, &point{0, 0}},
|
||||
{[]string{keyRight, keyLeft}, true, &point{0, 0}},
|
||||
|
Loading…
Reference in New Issue
Block a user