cursorDelete deletes character(s) immediately after the cursor
(steps int)
| 807 | |
| 808 | // cursorDelete deletes character(s) immediately after the cursor |
| 809 | func (tf *TextField) cursorDelete(steps int) { |
| 810 | if tf.hasSelection() { |
| 811 | tf.deleteSelection() |
| 812 | return |
| 813 | } |
| 814 | if tf.cursorPos+steps > len(tf.editText) { |
| 815 | steps = len(tf.editText) - tf.cursorPos |
| 816 | } |
| 817 | if steps <= 0 { |
| 818 | return |
| 819 | } |
| 820 | tf.edited = true |
| 821 | tf.editText = append(tf.editText[:tf.cursorPos], tf.editText[tf.cursorPos+steps:]...) |
| 822 | tf.NeedsRender() |
| 823 | } |
| 824 | |
| 825 | // cursorBackspaceWord deletes words(s) immediately before cursor |
| 826 | func (tf *TextField) cursorBackspaceWord(steps int) { |
no test coverage detected