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