Skip to content

Commit

Permalink
migrate editor to a newer, up to date implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cube707 committed Jan 3, 2024
1 parent adbed51 commit 33c7d9c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 17 deletions.
62 changes: 48 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
python = ">=3.8.1"
blessed = ">=1.19.0"
readchar = ">=3.0.6"
python-editor = ">=1.0.4"
editor = { git = "https://github.com/Cube707/editor" } # ">=1.5.1" # TODO: waiting for https://github.com/rec/editor/pull/8

[tool.poetry.dev-dependencies]
bandit = ">=1.7.4"
Expand Down
4 changes: 2 additions & 2 deletions src/inquirer/render/console/_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def process_input(self, pressed):
raise KeyboardInterrupt()

if pressed in (key.CR, key.LF, key.ENTER):
data = editor.edit(contents=self.question.default or "")
raise errors.EndOfInput(data.decode("utf-8"))
data = editor(text=self.question.default or "")
raise errors.EndOfInput(data)

raise errors.ValidationError(
"You have pressed unknown key! " "Press <enter> to open editor or " "CTRL+C to exit."
Expand Down

0 comments on commit 33c7d9c

Please sign in to comment.