(cm, bound, dropShift)
| 12 | |
| 13 | // Run a handler that was bound to a key. |
| 14 | function doHandleBinding(cm, bound, dropShift) { |
| 15 | if (typeof bound == "string") { |
| 16 | bound = commands[bound] |
| 17 | if (!bound) return false |
| 18 | } |
| 19 | // Ensure previous input has been read, so that the handler sees a |
| 20 | // consistent view of the document |
| 21 | cm.display.input.ensurePolled() |
| 22 | let prevShift = cm.display.shift, done = false |
| 23 | try { |
| 24 | if (cm.isReadOnly()) cm.state.suppressEdits = true |
| 25 | if (dropShift) cm.display.shift = false |
| 26 | done = bound(cm) != Pass |
| 27 | } finally { |
| 28 | cm.display.shift = prevShift |
| 29 | cm.state.suppressEdits = false |
| 30 | } |
| 31 | return done |
| 32 | } |
| 33 | |
| 34 | function lookupKeyForEditor(cm, name, handle) { |
| 35 | for (let i = 0; i < cm.state.keyMaps.length; i++) { |
no test coverage detected