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

Method onCursorX

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

Source from the content-addressed store, hash-verified

202 this.cursorOffset = null;
203 }
204 onCursorX(code, sign) {
205 var offset = this.onCursorBefore(code, sign);
206 this.cursorLocation = null;
207 if (controlKey) {
208 if (sign > 0) {
209 offset = code.findLineBreak(offset, sign > 0);
210 if (offset < code.length)
211 offset--;
212 }
213 else
214 offset = code.findLineBreak(offset, false);
215 }
216 else if (optionKey)
217 offset = code.findWordBreak(offset, sign > 0);
218 else if (!code.selectionLength || shiftKey)
219 offset += sign;
220 this.onCursorAfter(code, offset);
221 }
222 onCursorY(code, sign) {
223 var offset = this.onCursorBefore(code, sign);
224 if (controlKey || this.field) {

Callers 1

onKeyDownMethod · 0.95

Calls 2

onCursorBeforeMethod · 0.95
onCursorAfterMethod · 0.95

Tested by

no test coverage detected