MCPcopy Create free account
hub / github.com/g3n/engine / CursorBack

Method CursorBack

gui/edit.go:150–158  ·  view source on GitHub ↗

CursorBack deletes the character at left of the cursor if possible

()

Source from the content-addressed store, hash-verified

148
149// CursorBack deletes the character at left of the cursor if possible
150func (ed *Edit) CursorBack() {
151
152 if ed.col > 0 {
153 ed.col--
154 ed.text = text.StrRemove(ed.text, ed.col)
155 ed.redraw(ed.focus)
156 ed.Dispatch(OnChange, nil)
157 }
158}
159
160// CursorHome moves the edit cursor to the beginning of the text
161func (ed *Edit) CursorHome() {

Callers 1

onKeyMethod · 0.95

Calls 3

redrawMethod · 0.95
StrRemoveFunction · 0.92
DispatchMethod · 0.65

Tested by

no test coverage detected