parent
9fe4fa8984
commit
a22a9843fb
|
@ -188,6 +188,8 @@ class Application(object):
|
|||
self.config['max_num_kills'] = 64
|
||||
self.config['word_letters'] = string.letters + string.digits
|
||||
self.config['default_color'] = ('default', 'default',)
|
||||
self.config['margin'] = 80
|
||||
self.config['margin_color'] = 'blue'
|
||||
|
||||
def completion_window_is_open(self):
|
||||
n = self.complete_slot
|
||||
|
@ -778,12 +780,14 @@ class Application(object):
|
|||
count += 1
|
||||
|
||||
if w.margins_visible:
|
||||
for (limit, shade) in w.margins:
|
||||
if limit < self.x:
|
||||
for j in range(0, slot.height):
|
||||
char = chr(self.win.inch(j + slot.y_offset, limit) & 255)
|
||||
attr = color.build('default', shade, 'bold')
|
||||
self.win.addstr(j + slot.y_offset, limit + w.mode.lmargin, char, attr)
|
||||
shade = util.get_margin_color(w, 'blue')
|
||||
limit = util.get_margin_limit(w, 80)
|
||||
if limit < self.x:
|
||||
for j in range(0, slot.height):
|
||||
char = chr(self.win.inch(j + slot.y_offset, limit) & 255)
|
||||
attr = color.build('default', shade, 'bold')
|
||||
self.win.addstr(j + slot.y_offset, limit + w.mode.lmargin,
|
||||
char, attr)
|
||||
|
||||
def _draw_slot(self, i):
|
||||
slot = self.bufferlist.slots[i]
|
||||
|
|
|
@ -77,7 +77,8 @@ class PythonGrammar(Grammar):
|
|||
|
||||
class PythonTabber(tab.StackTabber):
|
||||
# NOTE: yield might initially seem like an endlevel name, but it's not one.
|
||||
endlevel_names = ('pass', 'return', 'raise', 'break', 'continue')
|
||||
# NOTE: return should be an endlevel name but for now it can't b
|
||||
endlevel_names = ('pass', 'raise', 'break', 'continue')
|
||||
startlevel_names = ('if', 'try', 'class', 'def', 'for', 'while', 'try')
|
||||
def __init__(self, m):
|
||||
tab.StackTabber.__init__(self, m)
|
||||
|
|
7
util.py
7
util.py
|
@ -47,3 +47,10 @@ def get_margin_limit(w, def_limit=80):
|
|||
return w.application.config[lname]
|
||||
else:
|
||||
return w.application.config.get('margin', def_limit)
|
||||
|
||||
def get_margin_color(w, def_color='blue'):
|
||||
lname = '%s.margin_color' % w.mode.name().lower()
|
||||
if lname in w.application.config:
|
||||
return w.application.config[lname]
|
||||
else:
|
||||
return w.application.config.get('margin_color', def_color)
|
||||
|
|
|
@ -17,7 +17,9 @@ from render import RenderString
|
|||
# the shorter line will "set" the cursor to its position on the shorter line.
|
||||
|
||||
class Window(object):
|
||||
margins = ((80, 'blue'),)
|
||||
#margins = ((80, 'blue'),)
|
||||
#margin_limit = 80
|
||||
#margin_color = 'blue'
|
||||
margins_visible = False
|
||||
def __init__(self, b, a, height=24, width=80, mode_name=None):
|
||||
self.buffer = b
|
||||
|
|
Loading…
Reference in New Issue