(cm, bound, dropShift)
| 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++) { |
no outgoing calls
no test coverage detected