Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a configurable default mode so we don't have to start in INSERT #1632

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/prompt_toolkit/key_binding/vi_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def __init__(self) -> None:
#: The Vi mode we're currently in to.
self.__input_mode = InputMode.INSERT

#: The Vi mode that gets applied when reset() is called
self.default_input_mode = InputMode.INSERT

#: Waiting for digraph.
self.waiting_for_digraph = False
self.digraph_symbol1: Optional[str] = None # (None or a symbol.)
Expand Down Expand Up @@ -96,7 +99,7 @@ def reset(self) -> None:
Reset state, go back to the given mode. INSERT by default.
"""
# Go back to insert mode.
self.input_mode = InputMode.INSERT
self.input_mode = self.default_input_mode

self.waiting_for_digraph = False
self.operator_func = None
Expand Down