From ce20fc8a9d249798e9349679b37d9452ee14c3e0 Mon Sep 17 00:00:00 2001 From: Petter Rodhelind Date: Fri, 23 Feb 2018 19:33:21 +0100 Subject: Make arrow right move q1, end of selection. --- view.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'view.go') diff --git a/view.go b/view.go index 4d9150a..ff272a6 100644 --- a/view.go +++ b/view.go @@ -4,7 +4,6 @@ import ( "io" "path/filepath" "time" - "unicode" "unicode/utf8" "github.com/atotto/clipboard" @@ -358,18 +357,12 @@ func (v *View) HandleEvent(ev tcell.Event) { case tcell.KeyCR: // use unix style 0x0A (\n) for new lines key = tcell.KeyLF case tcell.KeyRight: - //if ev.Modifiers()&tcell.ModShift != 0 { - // v.text.ExpandDot(1, 1) - //} else { + _, q1 := v.text.Dot() + v.SetCursor(q1, io.SeekStart) v.SetCursor(utf8.RuneLen(v.Rune()), io.SeekCurrent) - //} return case tcell.KeyLeft: - //if ev.Modifiers()&tcell.ModShift != 0 { - // v.text.ExpandDot(1, -1) - //} else { v.SetCursor(-1, io.SeekCurrent) - //} return case tcell.KeyDown: fallthrough -- cgit v1.2.3