(cm, e)
| 4159 | |
| 4160 | // Handle a key from the keydown event. |
| 4161 | function handleKeyBinding(cm, e) { |
| 4162 | var name = keyName(e, true); |
| 4163 | if (!name) return false; |
| 4164 | |
| 4165 | if (e.shiftKey && !cm.state.keySeq) { |
| 4166 | // First try to resolve full name (including 'Shift-'). Failing |
| 4167 | // that, see if there is a cursor-motion command (starting with |
| 4168 | // 'go') bound to the keyname without 'Shift-'. |
| 4169 | return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) |
| 4170 | || dispatchKey(cm, name, e, function(b) { |
| 4171 | if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) |
| 4172 | return doHandleBinding(cm, b); |
| 4173 | }); |
| 4174 | } else { |
| 4175 | return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); |
| 4176 | } |
| 4177 | } |
| 4178 | |
| 4179 | // Handle a key from the keypress event |
| 4180 | function handleCharBinding(cm, e, ch) { |
no test coverage detected