MCPcopy
hub / github.com/witheve/Eve / prepareSelectAllHack

Function prepareSelectAllHack

src/codemirror.js:1509–1521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1507 // this adds a zero-width space so that we can later check whether
1508 // it got selected.
1509 function prepareSelectAllHack() {
1510 if (te.selectionStart != null) {
1511 var selected = cm.somethingSelected();
1512 var extval = "\u200b" + (selected ? te.value : "");
1513 te.value = "\u21da"; // Used to catch context-menu undo
1514 te.value = extval;
1515 input.prevInput = selected ? "" : "\u200b";
1516 te.selectionStart = 1; te.selectionEnd = extval.length;
1517 // Re-set this, in case some other handler touched the
1518 // selection in the meantime.
1519 display.selForContextMenu = cm.doc.sel;
1520 }
1521 }
1522 function rehide() {
1523 input.contextMenuPending = false;
1524 input.wrapper.style.cssText = oldWrapperCSS

Callers 2

rehideFunction · 0.85
codemirror.jsFile · 0.85

Calls 1

somethingSelectedMethod · 0.80

Tested by

no test coverage detected