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

Function doHandleBinding

static/editor.md/lib/codemirror/lib/codemirror.js:3912–3930  ·  view source on GitHub ↗
(cm, bound, dropShift)

Source from the content-addressed store, hash-verified

3910
3911 // Run a handler that was bound to a key.
3912 function doHandleBinding(cm, bound, dropShift) {
3913 if (typeof bound == "string") {
3914 bound = commands[bound];
3915 if (!bound) return false;
3916 }
3917 // Ensure previous input has been read, so that the handler sees a
3918 // consistent view of the document
3919 cm.display.input.ensurePolled();
3920 var prevShift = cm.display.shift, done = false;
3921 try {
3922 if (isReadOnly(cm)) cm.state.suppressEdits = true;
3923 if (dropShift) cm.display.shift = false;
3924 done = bound(cm) != Pass;
3925 } finally {
3926 cm.display.shift = prevShift;
3927 cm.state.suppressEdits = false;
3928 }
3929 return done;
3930 }
3931
3932 function lookupKeyForEditor(cm, name, handle) {
3933 for (var i = 0; i < cm.state.keyMaps.length; i++) {

Callers 2

handleKeyBindingFunction · 0.70
handleCharBindingFunction · 0.70

Calls 2

isReadOnlyFunction · 0.70
boundFunction · 0.50

Tested by

no test coverage detected