(cm, e)
| 7218 | |
| 7219 | // Handle a key from the keydown event. |
| 7220 | function handleKeyBinding(cm, e) { |
| 7221 | var name = keyName(e, true); |
| 7222 | if (!name) { return false } |
| 7223 | |
| 7224 | if (e.shiftKey && !cm.state.keySeq) { |
| 7225 | // First try to resolve full name (including 'Shift-'). Failing |
| 7226 | // that, see if there is a cursor-motion command (starting with |
| 7227 | // 'go') bound to the keyname without 'Shift-'. |
| 7228 | return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) |
| 7229 | || dispatchKey(cm, name, e, function (b) { |
| 7230 | if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) |
| 7231 | { return doHandleBinding(cm, b) } |
| 7232 | }) |
| 7233 | } else { |
| 7234 | return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) |
| 7235 | } |
| 7236 | } |
| 7237 | |
| 7238 | // Handle a key from the keypress event |
| 7239 | function handleCharBinding(cm, e, ch) { |
no test coverage detected