function handleMacroRecording() {
          var macroModeState = vimGlobalState.macroModeState;
          if (macroModeState.isRecording) {
            if (key == 'q') {
              macroModeState.exitMacroRecordMode();
              clearInputState(cm);
              return true;
            }
            if (origin != 'mapping') {
              logKey(macroModeState, key);
            }
          }
        }
This is the outermost function called by CodeMirror, after keys have
been mapped to their Vim equivalents.

Finds a command based on the key (and cached keys if there is a
multi-key sequence). Returns `undefined` if no key is matched, a noop
function if a partial match is found (multi-key), and a function to
execute the bound command if a a key is matched. The function always
returns true.