diff options
| author | Kathryn Lingel <kathryn@lingel.net> | 2019-05-06 12:16:29 -0700 |
|---|---|---|
| committer | Kathryn Lingel <kathryn@lingel.net> | 2019-05-06 12:16:29 -0700 |
| commit | 54aa1ce6deb1b2505b8ab2ce4c9ecc5899466b2d (patch) | |
| tree | 019a8c703653de4ce4c65521d461484e86e72b9a /py | |
| parent | ccd22ab26a4168564d2731acca74ab5cf936fd54 (diff) | |
Filter private methods from tab completion
Diffstat (limited to 'py')
| -rw-r--r-- | py/repl.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -187,6 +187,11 @@ size_t mp_repl_autocomplete(const char *str, size_t len, const mp_print_t *print if (s_len <= d_len && strncmp(s_start, d_str, s_len) == 0) { mp_load_method_protected(obj, q, dest, true); if (dest[0] != MP_OBJ_NULL) { + // special case; filter out words that begin with underscore + // unless there's already a partial match + if (s_len == 0 && *d_str == '_') { + continue; + } if (match_str == NULL) { match_str = d_str; match_len = d_len; |
