MCPcopy Create free account
hub / github.com/cogentcore/core / Selection

Method Selection

texteditor/select.go:62–67  ·  view source on GitHub ↗

Selection returns the currently selected text as a text.Edit, which captures start, end, and full lines in between -- nil if no selection

()

Source from the content-addressed store, hash-verified

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
62func (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
70func (ed *Editor) selectModeToggle() {

Callers 4

QReplacePromptMethod · 0.95
offerCorrectMethod · 0.95
CopyMethod · 0.95
ReCaseSelectionMethod · 0.95

Calls 2

HasSelectionMethod · 0.95
RegionMethod · 0.45

Tested by

no test coverage detected