MCPcopy Create free account
hub / github.com/TruthHun/BookStack / doHandleBinding

Function doHandleBinding

static/mergely/lib/codemirror.js:4076–4094  ·  view source on GitHub ↗
(cm, bound, dropShift)

Source from the content-addressed store, hash-verified

4074
4075 // Run a handler that was bound to a key.
4076 function doHandleBinding(cm, bound, dropShift) {
4077 if (typeof bound == "string") {
4078 bound = commands[bound];
4079 if (!bound) return false;
4080 }
4081 // Ensure previous input has been read, so that the handler sees a
4082 // consistent view of the document
4083 cm.display.input.ensurePolled();
4084 var prevShift = cm.display.shift, done = false;
4085 try {
4086 if (cm.isReadOnly()) cm.state.suppressEdits = true;
4087 if (dropShift) cm.display.shift = false;
4088 done = bound(cm) != Pass;
4089 } finally {
4090 cm.display.shift = prevShift;
4091 cm.state.suppressEdits = false;
4092 }
4093 return done;
4094 }
4095
4096 function lookupKeyForEditor(cm, name, handle) {
4097 for (var i = 0; i < cm.state.keyMaps.length; i++) {

Callers 2

handleKeyBindingFunction · 0.70
handleCharBindingFunction · 0.70

Calls 1

boundFunction · 0.50

Tested by

no test coverage detected