pmacs3/mode/mini.py

26 lines
769 B
Python
Raw Normal View History

2007-10-21 20:55:29 -04:00
import method, mode
2007-07-21 11:40:53 -04:00
class MiniCallback(method.Method):
def execute(self, window, **vargs):
window.buffer.do_callback()
class MiniTabComplete(method.Method):
def execute(self, window, **vargs):
b = window.buffer
if b.tabber is None:
window.application.set_error("No tab completion")
return
s1 = b.make_string()
s2, exists, complete = b.tabber.tab_string(s1, window)
b.set_data(s2)
2007-10-19 02:41:33 -04:00
2008-04-18 23:32:08 -04:00
class Mini(mode.Fundamental):
modename = 'Mini'
actions = [MiniCallback, MiniTabComplete]
def __init__(self, w):
mode.Fundamental.__init__(self, w)
self.add_bindings('mini-callback', ('RETURN',))
self.add_bindings('mini-tab-complete', ('TAB',))
2007-10-19 02:41:33 -04:00
install = Mini.install