Пример #1
0
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')
Пример #2
0
 def on_focus(self):
     mode.toggle_mode('insert')
Пример #3
0
def esc():
    body.maximize_dialogs()
    mode.toggle_mode('normal')
Пример #4
0
from app.mode.mode import mode

shortcut = {
    'esc': lambda: mode.toggle_mode('normal')
}
Пример #5
0
from app.mode.mode import mode

shortcut = {
    ':': lambda: mode.toggle_mode('command'),
    'enter': lambda: mode.toggle_mode('insert'),
    'i': lambda: mode.toggle_mode('insert')
}