Fix current line display, automatic formatting fixes
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2021-04-01 16:47:32 -04:00
parent 818b8cf6bf
commit 1a4f6809fb
8 changed files with 21 additions and 21 deletions

View File

@ -8,7 +8,7 @@ import (
type document struct {
filename string
rows []*row
rows []*row
}
func newDocument() *document {

View File

@ -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

View File

@ -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 {

View File

@ -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"
)
keyHome = "HOME"
keyEnd = "END"
keyDelete = "DELETE"
)

View File

@ -5,7 +5,7 @@ import (
)
type row struct {
chars []rune
chars []rune
render []rune
}

View File

@ -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{

View File

@ -3,7 +3,7 @@ package key
import "testing"
type isRune struct {
arg1 rune
arg1 rune
expected bool
}

View File

@ -32,7 +32,7 @@ const (
// Color sequences
const (
InvertColor = EscPrefix + "7m"
ResetColor = EscPrefix + "m"
ResetColor = EscPrefix + "m"
)
// ----------------------------------------------------------------------------