Fix small bug with word selection

This commit is contained in:
Zachary Yedidia
2016-03-28 19:31:32 -04:00
parent 43bf1e2d4e
commit 77164fd08c

View File

@@ -127,6 +127,10 @@ func (c *Cursor) AddLineToSelection() {
// SelectWord selects the word the cursor is currently on
func (c *Cursor) SelectWord() {
if !IsWordChar(string(c.RuneUnder(c.x))) {
loc := c.Loc()
c.curSelection[0] = loc
c.curSelection[1] = loc
c.origSelection = c.curSelection
return
}