(cm, e)
| 7118 | |
| 7119 | // Handle a key from the keydown event. |
| 7120 | function handleKeyBinding(cm, e) { |
| 7121 | var name = keyName(e, true); |
| 7122 | if (!name) { return false } |
| 7123 | |
| 7124 | if (e.shiftKey && !cm.state.keySeq) { |
| 7125 | // First try to resolve full name (including 'Shift-'). Failing |
| 7126 | // that, see if there is a cursor-motion command (starting with |
| 7127 | // 'go') bound to the keyname without 'Shift-'. |
| 7128 | return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) |
| 7129 | || dispatchKey(cm, name, e, function (b) { |
| 7130 | if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) |
| 7131 | { return doHandleBinding(cm, b) } |
| 7132 | }) |
| 7133 | } else { |
| 7134 | return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) |
| 7135 | } |
| 7136 | } |
| 7137 | |
| 7138 | // Handle a key from the keypress event |
| 7139 | function handleCharBinding(cm, e, ch) { |
no test coverage detected