MCPcopy
hub / github.com/micro-editor/micro / Deselect

Method Deselect

internal/buffer/cursor.go:191–201  ·  view source on GitHub ↗

Deselect closes the cursor's current selection Start indicates whether the cursor should be placed at the start or end of the selection

(start bool)

Source from the content-addressed store, hash-verified

189// Start indicates whether the cursor should be placed
190// at the start or end of the selection
191func (c *Cursor) Deselect(start bool) {
192 if c.HasSelection() {
193 if start {
194 c.Loc = c.CurSelection[0]
195 } else {
196 c.Loc = c.CurSelection[1]
197 }
198 c.ResetSelection()
199 c.StoreVisualX()
200 }
201}
202
203// GetSelection returns the cursor's selection
204func (c *Cursor) GetSelection() []byte {

Callers 2

DeselectCursorsMethod · 0.45
ClearCursorsMethod · 0.45

Calls 3

HasSelectionMethod · 0.95
ResetSelectionMethod · 0.95
StoreVisualXMethod · 0.95

Tested by

no test coverage detected