louisdh / openterm

OpenTerm, a sandboxed command line interface for iOS
Other
1.63k stars 249 forks source link

Make autocomplete with external keyboard behave better #136

Closed holzschu closed 6 years ago

holzschu commented 6 years ago

When the user presses "tab" on an external keyboard, OpenTerm calls completeCommand, which completes the command. This command is different from the standard auto-complete method, and it has several issues: it can't autocomplete on a directory inside a directory, and it replaces all occurences of the search string with the replacement string, causing problems ("diff di[tab]" produces "diff.cff diff.c", which was not what I expected).

Rather than rewrite everything, I suggest we call autoComplete insertCompletion, which already updates currentCommand and calls autoCompleteManager.reloadData().

louisdh commented 6 years ago

Makes sense, thanks!