Fix current line display, automatic formatting fixes
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
This commit is contained in:
parent
818b8cf6bf
commit
1a4f6809fb
@ -8,7 +8,7 @@ import (
|
||||
|
||||
type document struct {
|
||||
filename string
|
||||
rows []*row
|
||||
rows []*row
|
||||
}
|
||||
|
||||
func newDocument() *document {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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"
|
||||
)
|
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type row struct {
|
||||
chars []rune
|
||||
chars []rune
|
||||
render []rune
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
@ -3,7 +3,7 @@ package key
|
||||
import "testing"
|
||||
|
||||
type isRune struct {
|
||||
arg1 rune
|
||||
arg1 rune
|
||||
expected bool
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ const (
|
||||
// Color sequences
|
||||
const (
|
||||
InvertColor = EscPrefix + "7m"
|
||||
ResetColor = EscPrefix + "m"
|
||||
ResetColor = EscPrefix + "m"
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user