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

Method selectRegionUpdate

texteditor/nav.go:171–179  ·  view source on GitHub ↗

selectRegionUpdate updates current select region based on given cursor position relative to SelectStart position

(pos lexer.Pos)

Source from the content-addressed store, hash-verified

169// selectRegionUpdate updates current select region based on given cursor position
170// relative to SelectStart position
171func (ed *Editor) selectRegionUpdate(pos lexer.Pos) {
172 if pos.IsLess(ed.selectStart) {
173 ed.SelectRegion.Start = pos
174 ed.SelectRegion.End = ed.selectStart
175 } else {
176 ed.SelectRegion.Start = ed.selectStart
177 ed.SelectRegion.End = pos
178 }
179}
180
181// cursorSelect updates selection based on cursor movements, given starting
182// cursor position and ed.CursorPos is current

Callers 4

cursorSelectMethod · 0.95
shiftSelectExtendMethod · 0.95
setCursorFromMouseMethod · 0.95
selectModeToggleMethod · 0.95

Calls 1

IsLessMethod · 0.80

Tested by

no test coverage detected