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

Function doHandleBinding

external/.scrollLibs.js:9744–9769  ·  view source on GitHub ↗
(cm, bound, dropShift)

Source from the content-addressed store, hash-verified

9742
9743 // Run a handler that was bound to a key.
9744 function doHandleBinding(cm, bound, dropShift) {
9745 if (typeof bound == "string") {
9746 bound = commands[bound]
9747 if (!bound) {
9748 return false
9749 }
9750 }
9751 // Ensure previous input has been read, so that the handler sees a
9752 // consistent view of the document
9753 cm.display.input.ensurePolled()
9754 var prevShift = cm.display.shift,
9755 done = false
9756 try {
9757 if (cm.isReadOnly()) {
9758 cm.state.suppressEdits = true
9759 }
9760 if (dropShift) {
9761 cm.display.shift = false
9762 }
9763 done = bound(cm) != Pass
9764 } finally {
9765 cm.display.shift = prevShift
9766 cm.state.suppressEdits = false
9767 }
9768 return done
9769 }
9770
9771 function lookupKeyForEditor(cm, name, handle) {
9772 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