cursorDown moves the cursor down
(steps int)
| 728 | |
| 729 | // cursorDown moves the cursor down |
| 730 | func (tf *TextField) cursorDown(steps int) { |
| 731 | if tf.numLines <= 1 { |
| 732 | return |
| 733 | } |
| 734 | if tf.cursorLine >= tf.numLines-1 { |
| 735 | return |
| 736 | } |
| 737 | |
| 738 | _, ri, _ := tf.renderAll.RuneSpanPos(tf.cursorPos) |
| 739 | tf.cursorLine = min(tf.cursorLine+steps, tf.numLines-1) |
| 740 | tf.cursorPos, _ = tf.renderAll.SpanPosToRuneIndex(tf.cursorLine, ri) |
| 741 | if tf.selectMode { |
| 742 | tf.selectRegionUpdate(tf.cursorPos) |
| 743 | } |
| 744 | tf.NeedsRender() |
| 745 | } |
| 746 | |
| 747 | // cursorUp moves the cursor up |
| 748 | func (tf *TextField) cursorUp(steps int) { |
no test coverage detected