MCPcopy Create free account
hub / github.com/breck7/scroll / prepareSelectAllHack

Function prepareSelectAllHack

external/.scrollLibs.js:13046–13059  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13044 // this adds a zero-width space so that we can later check whether
13045 // it got selected.
13046 function prepareSelectAllHack() {
13047 if (te.selectionStart != null) {
13048 var selected = cm.somethingSelected()
13049 var extval = "\u200b" + (selected ? te.value : "")
13050 te.value = "\u21da" // Used to catch context-menu undo
13051 te.value = extval
13052 input.prevInput = selected ? "" : "\u200b"
13053 te.selectionStart = 1
13054 te.selectionEnd = extval.length
13055 // Re-set this, in case some other handler touched the
13056 // selection in the meantime.
13057 display.selForContextMenu = cm.doc.sel
13058 }
13059 }
13060 function rehide() {
13061 if (input.contextMenuPending != rehide) {
13062 return

Callers 2

rehideFunction · 0.85
.scrollLibs.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected