From 0c015d7126652f29a2de836b8f0f587bda47cb41 Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 21 Jun 2007 21:24:56 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- application.py | 3 ++- mode_perl.py | 5 +++++ window2.py | 10 ++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/application.py b/application.py index 746e21d..5624dc8 100755 --- a/application.py +++ b/application.py @@ -590,7 +590,8 @@ class Application(object): s_offset = max(x - token.x, 0) x_offset = max(token.x - x, 0) - assert x_offset < slot.width, '%d < %d' % (x_offset, slot.width) + #assert x_offset < slot.width, '%d < %d' % (x_offset, slot.width) + assert x_offset <= slot.width, '%d <= %d' % (x_offset, slot.width) c = self._get_token_color(w, token) s = token.string[s_offset:] diff --git a/mode_perl.py b/mode_perl.py index e5f8fd8..2e4830b 100644 --- a/mode_perl.py +++ b/mode_perl.py @@ -177,6 +177,11 @@ class Perl(mode2.Fundamental): self.add_action_and_bindings(PerlWhichFunction(), ('C-c w',)) self.add_action_and_bindings(PerlListFunctions(), ('C-c W',)) + # visual tag matching + self.add_bindings('close-paren', (')')) + self.add_bindings('close-bracket', (']')) + self.add_bindings('close-brace', ('}')) + self.default_color = color.build('default', 'default') self.colors = { diff --git a/window2.py b/window2.py index 1d8e2f7..9f72dfb 100644 --- a/window2.py +++ b/window2.py @@ -222,14 +222,12 @@ class Window(object): self.cursor = Point(0, cursor.y) self.assure_visible_cursor() def previous_line(self): - cursor = self.logical_cursor() - if cursor.y > 0: - self.cursor = Point(cursor.x, cursor.y - 1) + if self.cursor.y > 0: + self.cursor = Point(self.cursor.x, self.cursor.y - 1) self.assure_visible_cursor() def next_line(self): - cursor = self.logical_cursor() - if cursor.y < len(self.buffer.lines) - 1: - self.cursor = Point(cursor.x, cursor.y + 1) + if self.cursor.y < len(self.buffer.lines) - 1: + self.cursor = Point(self.cursor.x, self.cursor.y + 1) self.assure_visible_cursor() # word handling