Cursor selection movement fix in TextEdit

This commit is contained in:
Luke I. Wilson 2021-03-18 16:47:20 -05:00
parent f7f864d125
commit cac950afd6

View File

@ -572,6 +572,7 @@ func (t *TextEdit) HandleEvent(event tcell.Event) bool {
case tcell.KeyLeft: case tcell.KeyLeft:
if ev.Modifiers() == tcell.ModShift { if ev.Modifiers() == tcell.ModShift {
if !t.selectMode { if !t.selectMode {
t.CursorLeft() // We want the character to the left to be selected only (think insert)
t.selection.StartLine, t.selection.StartCol = t.cury, t.curx t.selection.StartLine, t.selection.StartCol = t.cury, t.curx
t.selection.EndLine, t.selection.EndCol = t.cury, t.curx t.selection.EndLine, t.selection.EndCol = t.cury, t.curx
t.selectMode = true t.selectMode = true