(cm, e)
| 7174 | |
| 7175 | // Handle a key from the keydown event. |
| 7176 | function handleKeyBinding(cm, e) { |
| 7177 | var name = keyName(e, true); |
| 7178 | if (!name) { return false } |
| 7179 | |
| 7180 | if (e.shiftKey && !cm.state.keySeq) { |
| 7181 | // First try to resolve full name (including 'Shift-'). Failing |
| 7182 | // that, see if there is a cursor-motion command (starting with |
| 7183 | // 'go') bound to the keyname without 'Shift-'. |
| 7184 | return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) |
| 7185 | || dispatchKey(cm, name, e, function (b) { |
| 7186 | if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) |
| 7187 | { return doHandleBinding(cm, b) } |
| 7188 | }) |
| 7189 | } else { |
| 7190 | return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) |
| 7191 | } |
| 7192 | } |
| 7193 | |
| 7194 | // Handle a key from the keypress event |
| 7195 | function handleCharBinding(cm, e, ch) { |
no test coverage detected