This commit is contained in:
Florian Bruhin 2018-03-09 07:07:04 +01:00
parent 0cd73af691
commit b789e436b8

View File

@ -65,23 +65,30 @@ def init(win_id, parent):
modeman = ModeManager(win_id, parent) modeman = ModeManager(win_id, parent)
objreg.register('mode-manager', modeman, scope='window', window=win_id) objreg.register('mode-manager', modeman, scope='window', window=win_id)
keyparsers = { keyparsers = {
KM.normal: modeparsers.NormalKeyParser(win_id, modeman), KM.normal:
KM.hint: modeparsers.HintKeyParser(win_id, modeman), modeparsers.NormalKeyParser(win_id, modeman),
KM.insert: modeparsers.PassthroughKeyParser(win_id, 'insert', modeman), KM.hint:
KM.passthrough: modeparsers.PassthroughKeyParser(win_id, 'passthrough', modeparsers.HintKeyParser(win_id, modeman),
modeman), KM.insert:
KM.command: modeparsers.PassthroughKeyParser(win_id, 'command', modeman), modeparsers.PassthroughKeyParser(win_id, 'insert', modeman),
KM.prompt: modeparsers.PassthroughKeyParser(win_id, 'prompt', modeman), KM.passthrough:
KM.yesno: modeparsers.PromptKeyParser(win_id, modeman), modeparsers.PassthroughKeyParser(win_id, 'passthrough', modeman),
KM.caret: modeparsers.CaretKeyParser(win_id, modeman), KM.command:
KM.set_mark: modeparsers.RegisterKeyParser(win_id, KM.set_mark, modeparsers.PassthroughKeyParser(win_id, 'command', modeman),
modeman), KM.prompt:
KM.jump_mark: modeparsers.RegisterKeyParser(win_id, KM.jump_mark, modeparsers.PassthroughKeyParser(win_id, 'prompt', modeman),
modeman), KM.yesno:
KM.record_macro: modeparsers.RegisterKeyParser(win_id, KM.record_macro, modeparsers.PromptKeyParser(win_id, modeman),
modeman), KM.caret:
KM.run_macro: modeparsers.RegisterKeyParser(win_id, KM.run_macro, modeparsers.CaretKeyParser(win_id, modeman),
modeman), KM.set_mark:
modeparsers.RegisterKeyParser(win_id, KM.set_mark, modeman),
KM.jump_mark:
modeparsers.RegisterKeyParser(win_id, KM.jump_mark, modeman),
KM.record_macro:
modeparsers.RegisterKeyParser(win_id, KM.record_macro, modeman),
KM.run_macro:
modeparsers.RegisterKeyParser(win_id, KM.run_macro, modeman),
} }
objreg.register('keyparsers', keyparsers, scope='window', window=win_id) objreg.register('keyparsers', keyparsers, scope='window', window=win_id)
modeman.destroyed.connect( modeman.destroyed.connect(