diff --git a/editor/document.go b/editor/document.go index d796134..3601672 100644 --- a/editor/document.go +++ b/editor/document.go @@ -8,7 +8,7 @@ import ( type document struct { filename string - rows []*row + rows []*row } func newDocument() *document { diff --git a/editor/draw.go b/editor/draw.go index 82ec11d..b7d4711 100644 --- a/editor/draw.go +++ b/editor/draw.go @@ -126,7 +126,7 @@ func (e *editor) drawStatusBar(ab *buffer) { return } - rightStatus := fmt.Sprintf("%d/%d", e.cursor.y, e.document.rowCount()) + rightStatus := fmt.Sprintf("%d/%d", e.cursor.y+1, e.document.rowCount()) rlength := len(rightStatus) statusLength := length + rlength diff --git a/editor/editor.go b/editor/editor.go index 266b2ba..3152204 100644 --- a/editor/editor.go +++ b/editor/editor.go @@ -22,12 +22,12 @@ type statusMsg struct { } type editor struct { - screen *terminal.Screen - cursor *point - offset *point + screen *terminal.Screen + cursor *point + offset *point document *document - status *statusMsg - renderX int + status *statusMsg + renderX int } func New() *editor { diff --git a/editor/keymap.go b/editor/keymap.go index e0fb4d3..3922128 100644 --- a/editor/keymap.go +++ b/editor/keymap.go @@ -5,13 +5,13 @@ package editor // ---------------------------------------------------------------------------- const ( - keyUp = "ARROW_UP" - keyDown = "ARROW_DOWN" - keyLeft = "ARROW_LEFT" - keyRight = "ARROW_RIGHT" - keyPageUp = "PAGE_UP" + keyUp = "ARROW_UP" + keyDown = "ARROW_DOWN" + keyLeft = "ARROW_LEFT" + keyRight = "ARROW_RIGHT" + keyPageUp = "PAGE_UP" keyPageDown = "PAGE_DOWN" - keyHome = "HOME" - keyEnd = "END" - keyDelete = "DELETE" -) \ No newline at end of file + keyHome = "HOME" + keyEnd = "END" + keyDelete = "DELETE" +) diff --git a/editor/row.go b/editor/row.go index 7185572..5a51964 100644 --- a/editor/row.go +++ b/editor/row.go @@ -5,7 +5,7 @@ import ( ) type row struct { - chars []rune + chars []rune render []rune } diff --git a/editor/row_test.go b/editor/row_test.go index f83e26f..fe9e289 100644 --- a/editor/row_test.go +++ b/editor/row_test.go @@ -41,8 +41,8 @@ func TestRenderSize(t *testing.T) { type insertRune struct { initial string - ch rune - at int + ch rune + at int } var insertRuneTests = []insertRune{ diff --git a/key/key_test.go b/key/key_test.go index 0ba333b..198b611 100644 --- a/key/key_test.go +++ b/key/key_test.go @@ -3,7 +3,7 @@ package key import "testing" type isRune struct { - arg1 rune + arg1 rune expected bool } diff --git a/terminal/ansi.go b/terminal/ansi.go index 87a6b99..eb5cd59 100644 --- a/terminal/ansi.go +++ b/terminal/ansi.go @@ -32,7 +32,7 @@ const ( // Color sequences const ( InvertColor = EscPrefix + "7m" - ResetColor = EscPrefix + "m" + ResetColor = EscPrefix + "m" ) // ----------------------------------------------------------------------------