From a20070c4a5407fc2ab889623eab27b6aa5143b4c Mon Sep 17 00:00:00 2001 From: Felix Angell Date: Tue, 8 May 2018 12:17:04 +0100 Subject: [PATCH] fixed right key going to a negative offset at the end of a line --- gui/buffer.go | 2 +- gui/palette.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/buffer.go b/gui/buffer.go index 5922d6e..462c666 100644 --- a/gui/buffer.go +++ b/gui/buffer.go @@ -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) diff --git a/gui/palette.go b/gui/palette.go index 2944d77..73b24ff 100644 --- a/gui/palette.go +++ b/gui/palette.go @@ -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