Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Fix autocomplete crash bug (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
PCSwingle authored Jan 2, 2024
1 parent fe7dc2f commit cc0135c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mentat/auto_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def _find_shlex_last_word_position(
return 0 if not remaining else -len(remaining[0])

def _command_argument_completion(self, buffer: str) -> List[Completion]:
if any(buffer.startswith(space) for space in whitespace):
return []
if not any(space in buffer for space in whitespace):
return self._replace_last_word(
buffer, [(name, name) for name in Command.get_command_names()]
Expand Down

0 comments on commit cc0135c

Please sign in to comment.