()
| 1601 | } |
| 1602 | |
| 1603 | func (label *Label) MoveCaretBackOneWord() int { |
| 1604 | |
| 1605 | start := label.Selection.CaretPos |
| 1606 | offset := 0 |
| 1607 | |
| 1608 | if start > 0 && (label.Text[start-1] == ' ' || label.Text[start-1] == '\n') { |
| 1609 | start-- |
| 1610 | offset = 1 |
| 1611 | } |
| 1612 | |
| 1613 | next := label.LastIndexOfRunes(start, " \n") |
| 1614 | |
| 1615 | if next < 0 { |
| 1616 | next = -label.Selection.CaretPos |
| 1617 | } |
| 1618 | |
| 1619 | if next > 0 { |
| 1620 | next++ |
| 1621 | } |
| 1622 | |
| 1623 | return -(start - next + offset) |
| 1624 | |
| 1625 | } |
| 1626 | |
| 1627 | func (label *Label) Update() { |
| 1628 |
no test coverage detected