def start(): colors.cache(args) root.render() try: #if args.lesh: # something = root.root['lesh'].command_line #else: something = root.root['some program'].ch.statements.items[1] root.cursor_c, root.cursor_r = project.find(something, root.lines) #root.cursor_c += 1 except Exception as e: log (e.__repr__(), ", cant set initial cursor position") #import parser_test #parser_test.test(root.root['some program'].ch.statements.items[0]) if args.load: load(args.load) if args.run: load(args.run) root.root['loaded program'].run() if args.replay: do_replay(False)
def do_post_render_move_cursor(s): if isinstance(s.root.post_render_move_caret, int): s.move_cursor_h(s.root.post_render_move_caret) else: #its a node log("moving cursor to " +str(s.root.post_render_move_caret)) s.cursor_c, s.cursor_r = project.find(s.root.post_render_move_caret, s.lines) s.root.post_render_move_caret = 0
def complete_arrows(self, arrows): if not self.arrows_visible: return [] r = [] for a in arrows: target = project.find(a[2], self.lines) if target: r.append(((a[0],a[1] - self.scroll_lines),target)) return r
def try_move_cursor(n): l = project.find(n, root.lines) if l: root.cursor_c, root.cursor_r = l