mirror of
https://github.com/felixangell/phi.git
synced 2024-09-11 15:55:25 +03:00
fixed right key going to a negative offset at the end of a line
This commit is contained in:
parent
5d9f658678
commit
a20070c4a5
@ -551,8 +551,8 @@ func (b *Buffer) moveRight() {
|
|||||||
if b.curs.x >= currLineLength && b.curs.y < len(b.contents)-1 {
|
if b.curs.x >= currLineLength && b.curs.y < len(b.contents)-1 {
|
||||||
// we're at the end of the line and we have
|
// we're at the end of the line and we have
|
||||||
// some lines after, let's wrap around
|
// some lines after, let's wrap around
|
||||||
b.moveDown()
|
|
||||||
b.curs.move(-currLineLength, 0)
|
b.curs.move(-currLineLength, 0)
|
||||||
|
b.moveDown()
|
||||||
} else if b.curs.x < b.contents[b.curs.y].Len() {
|
} else if b.curs.x < b.contents[b.curs.y].Len() {
|
||||||
// we have characters to the right, let's move along
|
// we have characters to the right, let's move along
|
||||||
b.curs.move(1, 0)
|
b.curs.move(1, 0)
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package gui
|
package gui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/felixangell/fuzzysearch/fuzzy"
|
"github.com/felixangell/fuzzysearch/fuzzy"
|
||||||
"github.com/felixangell/phi/cfg"
|
"github.com/felixangell/phi/cfg"
|
||||||
"github.com/felixangell/strife"
|
"github.com/felixangell/strife"
|
||||||
"github.com/veandco/go-sdl2/sdl"
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
"log"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var commandSet []string
|
var commandSet []string
|
||||||
|
Loading…
Reference in New Issue
Block a user