(cm, bound, dropShift)
| 7105 | |
| 7106 | // Run a handler that was bound to a key. |
| 7107 | function doHandleBinding(cm, bound, dropShift) { |
| 7108 | if (typeof bound == "string") { |
| 7109 | bound = commands[bound]; |
| 7110 | if (!bound) { return false } |
| 7111 | } |
| 7112 | // Ensure previous input has been read, so that the handler sees a |
| 7113 | // consistent view of the document |
| 7114 | cm.display.input.ensurePolled(); |
| 7115 | var prevShift = cm.display.shift, done = false; |
| 7116 | try { |
| 7117 | if (cm.isReadOnly()) { cm.state.suppressEdits = true; } |
| 7118 | if (dropShift) { cm.display.shift = false; } |
| 7119 | done = bound(cm) != Pass; |
| 7120 | } finally { |
| 7121 | cm.display.shift = prevShift; |
| 7122 | cm.state.suppressEdits = false; |
| 7123 | } |
| 7124 | return done |
| 7125 | } |
| 7126 | |
| 7127 | function lookupKeyForEditor(cm, name, handle) { |
| 7128 | for (var i = 0; i < cm.state.keyMaps.length; i++) { |
no outgoing calls
no test coverage detected