Skip to content

Commit

Permalink
More trying to get .pages-svg to complete
Browse files Browse the repository at this point in the history
It still fails because readline doesn't believe - can
be part of a token, and it isn't worth rewriting all the
completion to make this one case work
  • Loading branch information
rogerbinns committed Dec 13, 2024
1 parent 758e755 commit 245a861
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apsw/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -3268,7 +3268,7 @@ def complete(self, token, state):

def _get_prev_tokens(self, line, end):
"Returns the tokens prior to pos end in the line"
return re.findall(r'"?\w+"?', line[:end])
return re.findall(r'"?[\-\w]+"?', line[:end])

def complete_sql(self, line, token, beg, end):
"""Provide some completions for SQL
Expand Down Expand Up @@ -3419,7 +3419,9 @@ def complete_command(self, line, token, beg, end):
"""
if not self._builtin_commands:
self._builtin_commands = [
"." + x[len("command_") :] for x in dir(self) if x.startswith("command_") and x != "command_headers"
"." + x[len("command_") :].replace("_", "-")
for x in dir(self)
if x.startswith("command_") and x != "command_headers"
]

t = self._get_prev_tokens(line, end)
Expand Down

0 comments on commit 245a861

Please sign in to comment.