do tab-completion on OS-X stock python too (libedit)

Apple's stock python doesn't use GNU libreadline, instead it uses BSD
libedit with a readline compatibility interface. The syntax to enable
tab completion is different for libedit. By including both bindings,
autocomplete should work on both flavors.

Closes #37. Thanks to @wsanchez for the catch and the fix.
This commit is contained in:
Brian Warner 2016-06-02 20:50:52 -07:00
parent 13cda9e615
commit 0977ef02c4

View File

@ -88,6 +88,7 @@ def input_code_with_completion(prompt, initial_channelids, get_channel_ids,
import readline
c = CodeInputter(initial_channelids, get_channel_ids, code_length)
readline.parse_and_bind("tab: complete")
readline.parse_and_bind("bind ^I rl_complete")
readline.set_completer(c.wrap_completer)
readline.set_completer_delims("")
except ImportError: