From b24189f302ac471795a54814aed3036fa0eb5d46 Mon Sep 17 00:00:00 2001 From: moculus Date: Sat, 19 Jul 2008 20:00:11 +0000 Subject: [PATCH] updates --HG-- branch : pmacs2 --- application.py | 2 +- mode/c.py | 11 +++-------- mode/lisp.py | 10 +++++++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/application.py b/application.py index 591a2d1..9a43113 100755 --- a/application.py +++ b/application.py @@ -65,7 +65,7 @@ class Application(object): 'string.octal': ('magenta', 'default', 'bold'), 'string.escaped': ('magenta', 'default', 'bold'), 'string.end': ('green', 'default', 'bold'), - 'char': ('default', 'default', 'bold'), + 'char': ('green', 'default', 'bold'), 'integer': ('default', 'default', 'bold'), 'float': ('default', 'default', 'bold'), 'number': ('default', 'default', 'bold'), diff --git a/mode/c.py b/mode/c.py index 4b4ec70..7f1d1b1 100644 --- a/mode/c.py +++ b/mode/c.py @@ -97,8 +97,7 @@ class CTabber(tab.StackTabber): self._opt_pop('cont') token = self.get_token(y, i) if token.string == '{': - self._opt_pop('cond') - self._opt_pop('cont') + self._pop_while('cond', 'cont') if self.is_leftmost_token(y, i): currlvl = self.get_curr_level() tab.StackTabber._handle_open_token(self, currlvl, y, i) @@ -110,8 +109,7 @@ class CTabber(tab.StackTabber): token = self.get_token(y, i) if self.is_rightmost_token(y, i): if token.string == '}': - self._opt_pop('cond') - self._opt_pop('cont') + self._pop_while('cond', 'cont') elif self._has_markers() and self._peek_name() == 'cond': pass else: @@ -123,10 +121,7 @@ class CTabber(tab.StackTabber): token = self.get_token(y, i) fqname = token.fqname() if fqname == 'delimiter' and token.string == ';': - self._opt_pop('cond') - self._opt_pop('cont') - self._opt_pop('cond') - self._opt_pop('cont') + self._pop_while('cond', 'cont') elif fqname == 'keyword': if token.string in ('do', 'else', 'for', 'if', 'while'): diff --git a/mode/lisp.py b/mode/lisp.py index 5f82fe7..40115c4 100644 --- a/mode/lisp.py +++ b/mode/lisp.py @@ -21,12 +21,16 @@ class LispTabber(tab.StackTabber): def _handle_open_token(self, currlvl, y, i): token = self.get_token(y, i) rtoken = self.get_next_right_token(y, i) - if rtoken is not None and rtoken.string != '(': - rtoken = self.get_next_right_token(y, i + 1) if rtoken is None: level = self.get_curr_level() + self.mode.tabwidth + elif rtoken.string not in ('(', 'define', 'lambda'): + rtoken = self.get_next_right_token(y, i + 1) + if rtoken is None or rtoken.string != '(': + level = self.get_curr_level() + self.mode.tabwidth + else: + level = rtoken.x else: - level = rtoken.x + level = self.get_curr_level() + self.mode.tabwidth self._append(token.string, level) return currlvl