diff --git a/window.py b/window.py index afed9f5..7a23fa7 100644 --- a/window.py +++ b/window.py @@ -565,6 +565,8 @@ class Window(object): return (p1, p2) # deletion + def delete_char(self, p): + self.buffer.delete_char(p) def delete(self, p1, p2): self.buffer.delete(p1, p2) def delete_line(self): @@ -629,6 +631,12 @@ class Window(object): else: self.buffer.overwrite_char(p, c) self.cursor = Point(p.x + 1, p.y) + def replace_with_string(self, p1, p2, s): + self.buffer.delete(p1, p2) + self.insert_string(p1, s) + def replace_with_lines(self, p1, p2, lines): + self.buffer.delete(p1, p2) + self.insert_lines(p1, lines) # insertion def insert_string_at_cursor(self, s): @@ -676,6 +684,10 @@ class Window(object): self.goto(p) # highlighting tokens + def get_token_list(self, y): + return self.get_token_list_at_point(self.logical_cursor()) + def get_token_list_at_point(self, p): + return self.get_highlighter().tokens[p.y] def get_token(self): return self.get_token_at_point(self.logical_cursor()) def get_token2(self):