'Start or stop recording a macro.
Args:
register: Which register to store the macro in.'

@cmdutils.register(instance='macro-recorder', name='record-macro')
@cmdutils.argument('win_id', win_id=True)
def record_macro_command(self, win_id, register=None):

    if (self._recording_macro is None):
        if (register is None):
            mode_manager = modeman.instance(win_id)
            mode_manager.enter(usertypes.KeyMode.record_macro, 'record_macro')
        else:
            self.record_macro(register)
    else:
        message.info("Macro    '{}'    recorded.".format(self._recording_macro))
        self._recording_macro = None
