(cm, e)
| 81 | |
| 82 | // Handle a key from the keydown event. |
| 83 | function handleKeyBinding(cm, e) { |
| 84 | let name = keyName(e, true) |
| 85 | if (!name) return false |
| 86 | |
| 87 | if (e.shiftKey && !cm.state.keySeq) { |
| 88 | // First try to resolve full name (including 'Shift-'). Failing |
| 89 | // that, see if there is a cursor-motion command (starting with |
| 90 | // 'go') bound to the keyname without 'Shift-'. |
| 91 | return dispatchKey(cm, "Shift-" + name, e, b => doHandleBinding(cm, b, true)) |
| 92 | || dispatchKey(cm, name, e, b => { |
| 93 | if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) |
| 94 | return doHandleBinding(cm, b) |
| 95 | }) |
| 96 | } else { |
| 97 | return dispatchKey(cm, name, e, b => doHandleBinding(cm, b)) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // Handle a key from the keypress event |
| 102 | function handleCharBinding(cm, e, ch) { |
no test coverage detected