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

Function doHandleBinding

src/codemirror.js:4099–4117  ·  view source on GitHub ↗
(cm, bound, dropShift)

Source from the content-addressed store, hash-verified

4097
4098 // Run a handler that was bound to a key.
4099 function doHandleBinding(cm, bound, dropShift) {
4100 if (typeof bound == "string") {
4101 bound = commands[bound];
4102 if (!bound) return false;
4103 }
4104 // Ensure previous input has been read, so that the handler sees a
4105 // consistent view of the document
4106 cm.display.input.ensurePolled();
4107 var prevShift = cm.display.shift, done = false;
4108 try {
4109 if (cm.isReadOnly()) cm.state.suppressEdits = true;
4110 if (dropShift) cm.display.shift = false;
4111 done = bound(cm) != Pass;
4112 } finally {
4113 cm.display.shift = prevShift;
4114 cm.state.suppressEdits = false;
4115 }
4116 return done;
4117 }
4118
4119 function lookupKeyForEditor(cm, name, handle) {
4120 for (var i = 0; i < cm.state.keyMaps.length; i++) {

Callers 2

handleKeyBindingFunction · 0.85
handleCharBindingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected