(cm, bound, dropShift)
| 4074 | |
| 4075 | // Run a handler that was bound to a key. |
| 4076 | function doHandleBinding(cm, bound, dropShift) { |
| 4077 | if (typeof bound == "string") { |
| 4078 | bound = commands[bound]; |
| 4079 | if (!bound) return false; |
| 4080 | } |
| 4081 | // Ensure previous input has been read, so that the handler sees a |
| 4082 | // consistent view of the document |
| 4083 | cm.display.input.ensurePolled(); |
| 4084 | var prevShift = cm.display.shift, done = false; |
| 4085 | try { |
| 4086 | if (cm.isReadOnly()) cm.state.suppressEdits = true; |
| 4087 | if (dropShift) cm.display.shift = false; |
| 4088 | done = bound(cm) != Pass; |
| 4089 | } finally { |
| 4090 | cm.display.shift = prevShift; |
| 4091 | cm.state.suppressEdits = false; |
| 4092 | } |
| 4093 | return done; |
| 4094 | } |
| 4095 | |
| 4096 | function lookupKeyForEditor(cm, name, handle) { |
| 4097 | for (var i = 0; i < cm.state.keyMaps.length; i++) { |
no test coverage detected