(cm, bound, dropShift)
| 3910 | |
| 3911 | // Run a handler that was bound to a key. |
| 3912 | function doHandleBinding(cm, bound, dropShift) { |
| 3913 | if (typeof bound == "string") { |
| 3914 | bound = commands[bound]; |
| 3915 | if (!bound) return false; |
| 3916 | } |
| 3917 | // Ensure previous input has been read, so that the handler sees a |
| 3918 | // consistent view of the document |
| 3919 | cm.display.input.ensurePolled(); |
| 3920 | var prevShift = cm.display.shift, done = false; |
| 3921 | try { |
| 3922 | if (isReadOnly(cm)) cm.state.suppressEdits = true; |
| 3923 | if (dropShift) cm.display.shift = false; |
| 3924 | done = bound(cm) != Pass; |
| 3925 | } finally { |
| 3926 | cm.display.shift = prevShift; |
| 3927 | cm.state.suppressEdits = false; |
| 3928 | } |
| 3929 | return done; |
| 3930 | } |
| 3931 | |
| 3932 | function lookupKeyForEditor(cm, name, handle) { |
| 3933 | for (var i = 0; i < cm.state.keyMaps.length; i++) { |
no test coverage detected