diff --git a/cmd/micro/actions.go b/cmd/micro/actions.go index 3e92682a..e23b4fed 100644 --- a/cmd/micro/actions.go +++ b/cmd/micro/actions.go @@ -799,9 +799,7 @@ func (v *View) FindNext(usePlugin bool) bool { if v.Cursor.HasSelection() { searchStart = ToCharPos(v.Cursor.CurSelection[1], v.Buf) - if lastSearch == "" { // or always? FIXME - lastSearch = v.Cursor.GetSelection() - } + lastSearch = v.Cursor.GetSelection() } else { searchStart = ToCharPos(v.Cursor.Loc, v.Buf) } @@ -1003,7 +1001,7 @@ func (v *View) MoveLinesUp(usePlugin bool) bool { } v.Buf.MoveLinesUp( v.Cursor.Loc.Y, - v.Cursor.Loc.Y + 1, + v.Cursor.Loc.Y+1, ) v.Cursor.UpN(1) messenger.Message("Moved up current line") @@ -1042,7 +1040,7 @@ func (v *View) MoveLinesDown(usePlugin bool) bool { } v.Buf.MoveLinesDown( v.Cursor.Loc.Y, - v.Cursor.Loc.Y + 1, + v.Cursor.Loc.Y+1, ) v.Cursor.DownN(1) messenger.Message("Moved down current line") @@ -1055,7 +1053,6 @@ func (v *View) MoveLinesDown(usePlugin bool) bool { return true } - // Paste whatever is in the system clipboard into the buffer // Delete and paste if the user has a selection func (v *View) Paste(usePlugin bool) bool { diff --git a/cmd/micro/buffer.go b/cmd/micro/buffer.go index 1e30b50c..99edacf7 100644 --- a/cmd/micro/buffer.go +++ b/cmd/micro/buffer.go @@ -378,12 +378,12 @@ func (b *Buffer) MoveLinesUp(start int, end int) { utf8.RuneCount(b.lines[end-1]), end - 1, }, - "\n" + b.Line(start - 1), + "\n"+b.Line(start-1), ) } else { b.Insert( Loc{0, end}, - b.Line(start - 1) + "\n", + b.Line(start-1)+"\n", ) } b.Remove( @@ -401,7 +401,7 @@ func (b *Buffer) MoveLinesDown(start int, end int) { } b.Insert( Loc{0, start}, - b.Line(end) + "\n", + b.Line(end)+"\n", ) end += 1 b.Remove(