def testParseCommandsCorrectly(self): values = ((':100', EX_CMD( name=':', command='ex_goto', forced=False, range='100', args={}, parse_errors=[], )), ) for v, expected in values: self.assertEquals(parse_command(v), expected)
def testParseCommandsCorrectly(self): values = ( (':100', EX_CMD( name=':', command='ex_goto', forced=False, range='100', args={}, parse_errors=[], )), ) for v, expected in values: self.assertEquals(parse_command(v), expected)
def on_done(self, cmd_line): if not getattr(self, 'non_interactive', None): update_command_line_history(cmd_line, 'cmdline') else: self.non_interactive = False ex_cmd = parse_command(cmd_line) print ex_cmd if ex_cmd and ex_cmd.parse_errors: ex_error.display_error(ex_cmd.parse_errors[0]) return if ex_cmd and ex_cmd.name: if ex_cmd.range: ex_cmd.args['range'] = ex_cmd.range if ex_cmd.forced: ex_cmd.args['forced'] = ex_cmd.forced self.window.run_command(ex_cmd.command, ex_cmd.args) else: ex_error.display_error(ex_error.ERR_UNKNOWN_COMMAND, cmd_line)
def on_done(self, cmd_line): if not getattr(self, 'non_interactive', None): update_command_line_history(cmd_line, 'cmdline') else: self.non_interactive = False ex_cmd = parse_command(cmd_line) print ex_cmd if ex_cmd and ex_cmd.parse_errors: sublime.status_message('VintageEx: %s' % ex_cmd.parse_errors[0]) return if ex_cmd and ex_cmd.name: if ex_cmd.range: ex_cmd.args['range'] = ex_cmd.range if ex_cmd.forced: ex_cmd.args['forced'] = ex_cmd.forced self.view.run_command(ex_cmd.command, ex_cmd.args) else: sublime.status_message('VintageEx: unknown command (%s)' % cmd_line)