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',)