(cm, bound, dropShift)
| 2075 | } |
| 2076 | |
| 2077 | function doHandleBinding(cm, bound, dropShift) { |
| 2078 | if (typeof bound == "string") { |
| 2079 | bound = commands[bound]; |
| 2080 | if (!bound) return false; |
| 2081 | } |
| 2082 | // Ensure previous input has been read, so that the handler sees a |
| 2083 | // consistent view of the document |
| 2084 | if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; |
| 2085 | var doc = cm.doc, prevShift = doc.sel.shift, done = false; |
| 2086 | try { |
| 2087 | if (isReadOnly(cm)) cm.state.suppressEdits = true; |
| 2088 | if (dropShift) doc.sel.shift = false; |
| 2089 | done = bound(cm) != Pass; |
| 2090 | } finally { |
| 2091 | doc.sel.shift = prevShift; |
| 2092 | cm.state.suppressEdits = false; |
| 2093 | } |
| 2094 | return done; |
| 2095 | } |
| 2096 | |
| 2097 | function allKeyMaps(cm) { |
| 2098 | var maps = cm.state.keyMaps.slice(0); |
no test coverage detected