From e3c2335c14dbc8bd00c0107795f9b7b57a3d6d15 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 20 Aug 2016 12:31:52 -0700 Subject: [PATCH] Slight additional improvement to word movement --- cmd/micro/cursor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/micro/cursor.go b/cmd/micro/cursor.go index c902ae0b..69027410 100644 --- a/cmd/micro/cursor.go +++ b/cmd/micro/cursor.go @@ -185,9 +185,9 @@ func (c *Cursor) WordRight() { // WordLeft moves the cursor one word to the left func (c *Cursor) WordLeft() { + c.Left() for IsWhitespace(c.RuneUnder(c.X)) { if c.X == 0 { - c.Left() return } c.Left() @@ -199,6 +199,7 @@ func (c *Cursor) WordLeft() { } c.Left() } + c.Right() } // RuneUnder returns the rune under the given x position