(cm, bound, dropShift)
| 2937 | |
| 2938 | // Run a handler that was bound to a key. |
| 2939 | function doHandleBinding(cm, bound, dropShift) { |
| 2940 | if (typeof bound == "string") { |
| 2941 | bound = commands[bound]; |
| 2942 | if (!bound) return false; |
| 2943 | } |
| 2944 | // Ensure previous input has been read, so that the handler sees a |
| 2945 | // consistent view of the document |
| 2946 | if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; |
| 2947 | var prevShift = cm.display.shift, done = false; |
| 2948 | try { |
| 2949 | if (isReadOnly(cm)) cm.state.suppressEdits = true; |
| 2950 | if (dropShift) cm.display.shift = false; |
| 2951 | done = bound(cm) != Pass; |
| 2952 | } finally { |
| 2953 | cm.display.shift = prevShift; |
| 2954 | cm.state.suppressEdits = false; |
| 2955 | } |
| 2956 | return done; |
| 2957 | } |
| 2958 | |
| 2959 | // Collect the currently active keymaps. |
| 2960 | function allKeyMaps(cm) { |
no test coverage detected