def load_options(command, history): predicate = make_command_predicate(command) argstr = next(history.iter_matching(predicate), None) if argstr is not None: try: return command.parse(argstr) except Exception: log.warn("cannot load options: %s", argstr, exc_info=True) return command.arg_parser.default_options()
def recent_finds(self): predicate = make_command_predicate(find) items = self.app.text_commander.history.iter_matching(predicate) result = [] for i, item in enumerate(items): if i < 10: result.append(item) else: break return result
def recent_finds(self): # HACK global resource predicate = make_command_predicate(find) items = editxt.app.text_commander.history.iter_matching(predicate) result = [] for i, item in enumerate(items): if i < 10: result.append(item) else: break return result