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

Incompatible signature of complete_path -> _complete_path_raw #25

Open
doronz88 opened this issue May 13, 2024 · 0 comments · May be fixed by #26
Open

Incompatible signature of complete_path -> _complete_path_raw #25

doronz88 opened this issue May 13, 2024 · 0 comments · May be fixed by #26

Comments

@doronz88
Copy link

In recent xonsh versions, complete_path now receives a context.
In order to preserve the same functionality, a refactor of using _complete_path_raw instead if now necessary.

Till then, This causes the following bug to occur:

# Hitting Ctrl+T while in the following line
ls L<Ctrl+T>

Triggers the following exception:

Unhandled exception in event loop:
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 162, in callback_wrapper
    callback()
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 712, in read_from_input_in_context
    context.copy().run(read_from_input)
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 692, in read_from_input
    self.key_processor.process_keys()
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_processor.py", line 272, in process_keys
    self._process_coroutine.send(key_press)
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_processor.py", line 187, in _process
    self._call_handler(matches[-1], key_sequence=buffer[:])
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_processor.py", line 322, in _call_handler
    handler.call(event)
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 124, in call
    result = self.handler(event)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/xontrib/fzf-widgets.xsh", line 138, in fzf_file
    fzf_insert_file(event)

  File "/Users/user/Library/Application Support/pipx/venvs/xonsh/lib/python3.11/site-packages/xontrib/fzf-widgets.xsh", line 66, in fzf_insert_file
    paths = complete_path(os.path.normpath(prefix), before_cursor, 0, len(before_cursor), None)[0]


Exception complete_path() takes 1 positional argument but 5 were given
Press ENTER to continue...
doronz88 added a commit to doronz88/xontrib-fzf-widgets that referenced this issue May 13, 2024
@doronz88 doronz88 linked a pull request May 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant