parent
bb302ee3a6
commit
b24189f302
|
@ -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'),
|
||||
|
|
11
mode/c.py
11
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'):
|
||||
|
|
|
@ -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 = self.get_curr_level() + self.mode.tabwidth
|
||||
self._append(token.string, level)
|
||||
return currlvl
|
||||
|
||||
|
|
Loading…
Reference in New Issue