MCPcopy Index your code
hub / github.com/csev/py4e / resetInput

Function resetInput

tools/pythonauto/static/codemirror/codemirror.js:1544–1559  ·  view source on GitHub ↗
(cm, user)

Source from the content-addressed store, hash-verified

1542 }
1543
1544 function resetInput(cm, user) {
1545 var minimal, selected, doc = cm.doc;
1546 if (!posEq(doc.sel.from, doc.sel.to)) {
1547 cm.display.prevInput = "";
1548 minimal = hasCopyEvent &&
1549 (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);
1550 var content = minimal ? "-" : selected || cm.getSelection();
1551 cm.display.input.value = content;
1552 if (cm.state.focused) selectInput(cm.display.input);
1553 if (ie && !ie_lt9) cm.display.inputHasSelection = content;
1554 } else if (user) {
1555 cm.display.prevInput = cm.display.input.value = "";
1556 if (ie && !ie_lt9) cm.display.inputHasSelection = null;
1557 }
1558 cm.display.inaccurateSelection = minimal;
1559 }
1560
1561 function focusInput(cm) {
1562 if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input))

Callers 6

endOperationFunction · 0.70
readInputFunction · 0.70
onFocusFunction · 0.70
onContextMenuFunction · 0.70
pollFunction · 0.70
codemirror.jsFile · 0.70

Calls 2

posEqFunction · 0.70
selectInputFunction · 0.70

Tested by

no test coverage detected