Exemple #1
0
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()
Exemple #2
0
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()
Exemple #3
0
 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
Exemple #4
0
 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