mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-19 13:51:02 +00:00
Slight additional improvement to word movement
This commit is contained in:
parent
198b1b8e79
commit
e3c2335c14
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue