selectUpdate updates the select region after any change to the text, to keep it in range
()
| 991 | |
| 992 | // selectUpdate updates the select region after any change to the text, to keep it in range |
| 993 | func (tf *TextField) selectUpdate() { |
| 994 | if tf.selectStart < tf.selectEnd { |
| 995 | ed := len(tf.editText) |
| 996 | if tf.selectStart < 0 { |
| 997 | tf.selectStart = 0 |
| 998 | } |
| 999 | if tf.selectEnd > ed { |
| 1000 | tf.selectEnd = ed |
| 1001 | } |
| 1002 | } else { |
| 1003 | tf.selectReset() |
| 1004 | } |
| 1005 | } |
| 1006 | |
| 1007 | // cut cuts any selected text and adds it to the clipboard. |
| 1008 | func (tf *TextField) cut() { //types:add |
no test coverage detected