fixed right key going to a negative offset at the end of a line

This commit is contained in:
Felix Angell 2018-05-08 12:17:04 +01:00
parent 5d9f658678
commit a20070c4a5
2 changed files with 4 additions and 3 deletions

View File

@ -551,8 +551,8 @@ func (b *Buffer) moveRight() {
if b.curs.x >= currLineLength && b.curs.y < len(b.contents)-1 {
// we're at the end of the line and we have
// some lines after, let's wrap around
b.moveDown()
b.curs.move(-currLineLength, 0)
b.moveDown()
} else if b.curs.x < b.contents[b.curs.y].Len() {
// we have characters to the right, let's move along
b.curs.move(1, 0)

View File

@ -1,12 +1,13 @@
package gui
import (
"log"
"strings"
"github.com/felixangell/fuzzysearch/fuzzy"
"github.com/felixangell/phi/cfg"
"github.com/felixangell/strife"
"github.com/veandco/go-sdl2/sdl"
"log"
"strings"
)
var commandSet []string