@@ -40,7 +40,7 @@ def __init__(self):
4040 self .named_registers = {}
4141
4242 #: The Vi mode we're currently in to.
43- self .input_mode = InputMode .INSERT
43+ self .__input_mode = InputMode .INSERT
4444
4545 #: Waiting for digraph.
4646 self .waiting_for_digraph = False
@@ -57,13 +57,32 @@ def __init__(self):
5757 self .recording_register = None
5858 self .current_recording = ''
5959
60- def reset (self , mode = InputMode .INSERT ):
60+ @property
61+ def input_mode (self ):
62+ " Get `InputMode`. "
63+ return self .__input_mode
64+
65+ @input_mode .setter
66+ def input_mode (self , value ):
67+ " Set `InputMode`. "
68+ if value == InputMode .NAVIGATION :
69+ self .waiting_for_digraph = False
70+ self .operator_func = None
71+ self .operator_arg = None
72+
73+ self .__input_mode = value
74+
75+ def reset (self ):
6176 """
6277 Reset state, go back to the given mode. INSERT by default.
6378 """
6479 # Go back to insert mode.
65- self .input_mode = mode
80+ self .input_mode = InputMode . INSERT
6681
6782 self .waiting_for_digraph = False
6883 self .operator_func = None
6984 self .operator_arg = None
85+
86+ # Reset recording state.
87+ self .recording_register = None
88+ self .current_recording = ''
0 commit comments