From fe7a462326785d6d675b41d09803daa4ab6dfd3d Mon Sep 17 00:00:00 2001 From: moculus Date: Mon, 2 Jun 2008 01:38:25 +0000 Subject: [PATCH] fixes to C mode and other bug fix --HG-- branch : pmacs2 --- buffer.py | 10 ++++------ mode/c.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/buffer.py b/buffer.py index c08c71b..5da8ff4 100644 --- a/buffer.py +++ b/buffer.py @@ -152,12 +152,10 @@ class Buffer(object): if w in self.windows: self.windows.remove(w) modename = w.mode.name() - found = False - for w2 in self.windows: - if w2.mode.name() == modename: - found = True - break - if not found: + if modename in self.highlights: + for w2 in self.windows: + if w2.mode.name() == modename: + return del self.highlights[modename] def _region_add(self, p1, p2, lines, act): move = DelMove(self, p1, p2) diff --git a/mode/c.py b/mode/c.py index 6259543..4b4ec70 100644 --- a/mode/c.py +++ b/mode/c.py @@ -205,7 +205,7 @@ class CMake(method.shell.Exec): class C(mode.Fundamental): modename = 'C' - extensions = ['.c'] + extensions = ['.c', '.h', '.cpp'] tabbercls = CTabber grammar = CGrammar opentokens = ('delimiter',)