cursorBackspace deletes character(s) immediately before cursor
(steps int)
| 789 | |
| 790 | // cursorBackspace deletes character(s) immediately before cursor |
| 791 | func (tf *TextField) cursorBackspace(steps int) { |
| 792 | if tf.hasSelection() { |
| 793 | tf.deleteSelection() |
| 794 | return |
| 795 | } |
| 796 | if tf.cursorPos < steps { |
| 797 | steps = tf.cursorPos |
| 798 | } |
| 799 | if steps <= 0 { |
| 800 | return |
| 801 | } |
| 802 | tf.edited = true |
| 803 | tf.editText = append(tf.editText[:tf.cursorPos-steps], tf.editText[tf.cursorPos:]...) |
| 804 | tf.cursorBackward(steps) |
| 805 | tf.NeedsRender() |
| 806 | } |
| 807 | |
| 808 | // cursorDelete deletes character(s) immediately after the cursor |
| 809 | func (tf *TextField) cursorDelete(steps int) { |
no test coverage detected