Selection returns the currently selected text as a text.Edit, which captures start, end, and full lines in between -- nil if no selection
()
| 60 | // Selection returns the currently selected text as a text.Edit, which |
| 61 | // captures start, end, and full lines in between -- nil if no selection |
| 62 | func (ed *Editor) Selection() *text.Edit { |
| 63 | if ed.HasSelection() { |
| 64 | return ed.Buffer.Region(ed.SelectRegion.Start, ed.SelectRegion.End) |
| 65 | } |
| 66 | return nil |
| 67 | } |
| 68 | |
| 69 | // selectModeToggle toggles the SelectMode, updating selection with cursor movement |
| 70 | func (ed *Editor) selectModeToggle() { |
no test coverage detected