1
0
Fork 0

fixed unknown symbol REPLACE_SINGLE in prompt_toolkit < 3.0.6 (#1246)

* fixed unknown symbol REPLACE_SINGLE in prompt_toolkit < 3.0.6

* changelog
This commit is contained in:
Georgy Frolov 2021-02-23 01:54:23 +03:00 committed by GitHub
parent 9ca545d880
commit 30212c6fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,7 @@ Bug fixes:
----------
* Fix issue where `syntax_style` config value would not have any effect. (#1212)
* Fix crash because of not found `InputMode.REPLACE_SINGLE` with prompt-toolkit < 3.0.6
3.1.0
=====

View File

@ -1,15 +1,20 @@
from packaging.version import parse as parse_version
import prompt_toolkit
from prompt_toolkit.key_binding.vi_state import InputMode
from prompt_toolkit.application import get_app
def _get_vi_mode():
return {
modes = {
InputMode.INSERT: "I",
InputMode.NAVIGATION: "N",
InputMode.REPLACE: "R",
InputMode.REPLACE_SINGLE: "R",
InputMode.INSERT_MULTIPLE: "M",
}[get_app().vi_state.input_mode]
}
if parse_version(prompt_toolkit.__version__) >= parse_version("3.0.6"):
modes[InputMode.REPLACE_SINGLE] = "R"
return modes[get_app().vi_state.input_mode]
def create_toolbar_tokens_func(pgcli):