MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onCursorBefore

Method onCursorBefore

tools/xsbug/behaviors.js:187–198  ·  view source on GitHub ↗
(code, sign)

Source from the content-addressed store, hash-verified

185 this.onSelected(code);
186 }
187 onCursorBefore(code, sign) {
188 if (shiftKey) {
189 if (this.cursorOffset == null)
190 this.cursorOffset = (sign < 0) ? code.selectionOffset : code.selectionOffset + code.selectionLength;
191 if (this.cursorAnchor == null)
192 this.cursorAnchor = (sign < 0) ? code.selectionOffset + code.selectionLength : code.selectionOffset;
193 return this.cursorOffset;
194 }
195 this.cursorOffset = null;
196 this.cursorAnchor = null;
197 return (sign < 0) ? code.selectionOffset : code.selectionOffset + code.selectionLength;
198 }
199 onCursorCancel(code, sign) {
200 this.cursorAnchor = null;
201 this.cursorLocation = null;

Callers 2

onCursorXMethod · 0.95
onCursorYMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected