cursorBackward moves the cursor backward
(steps int)
| 657 | |
| 658 | // cursorBackward moves the cursor backward |
| 659 | func (tf *TextField) cursorBackward(steps int) { |
| 660 | tf.cursorPos -= steps |
| 661 | if tf.cursorPos < 0 { |
| 662 | tf.cursorPos = 0 |
| 663 | } |
| 664 | if tf.cursorPos <= tf.startPos { |
| 665 | dec := min(tf.startPos, 8) |
| 666 | tf.startPos -= dec |
| 667 | } |
| 668 | tf.cursorLine, _, _ = tf.renderAll.RuneSpanPos(tf.cursorPos) |
| 669 | if tf.selectMode { |
| 670 | tf.selectRegionUpdate(tf.cursorPos) |
| 671 | } |
| 672 | tf.NeedsRender() |
| 673 | } |
| 674 | |
| 675 | // cursorBackwardWord moves the cursor backward by words |
| 676 | func (tf *TextField) cursorBackwardWord(steps int) { |
no test coverage detected