def do_command(line): args = shlex.split(line) if args[0] in app.commands: result = app.do_command(line, args) if result: command_line.set_edit_text(result) elif args[0] in test.commands: result = test.do_command(line, args) if result: command_line.set_edit_text(result) else: command_line.set_edit_text(error.command_unknown.format(command=args[0])) mode.toggle_mode('normal')
def on_focus(self): mode.toggle_mode('insert')
def esc(): body.maximize_dialogs() mode.toggle_mode('normal')
from app.mode.mode import mode shortcut = { 'esc': lambda: mode.toggle_mode('normal') }
from app.mode.mode import mode shortcut = { ':': lambda: mode.toggle_mode('command'), 'enter': lambda: mode.toggle_mode('insert'), 'i': lambda: mode.toggle_mode('insert') }