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