aboutsummaryrefslogtreecommitdiff
path: root/py/repl.c
diff options
context:
space:
mode:
authorscottbelden <scottabelden@gmail.com>2019-05-07 13:55:20 -0400
committerDamien George <damien@micropython.org>2021-05-02 23:11:07 +1000
commitbefbff31b73d5373b5933a3762a3a3c6e871e8da (patch)
treeae77c9c47ec9f7fbc9045c5fbc288e00377a41d1 /py/repl.c
parent1f1a54d0b1371efcfec6ca1b03d21b07a908c70d (diff)
py/repl: Enter four spaces when there are no matches.
Originally at adafruit#1859 Signed-off-by: scottbelden <scottabelden@gmail.com>
Diffstat (limited to 'py/repl.c')
-rw-r--r--py/repl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/repl.c b/py/repl.c
index 3b1837031..a8ae1d069 100644
--- a/py/repl.c
+++ b/py/repl.c
@@ -228,6 +228,10 @@ size_t mp_repl_autocomplete(const char *str, size_t len, const mp_print_t *print
// nothing found
if (q_first == 0) {
+ if (s_len == 0) {
+ *compl_str = " ";
+ return 4;
+ }
// If there're no better alternatives, and if it's first word
// in the line, try to complete "import".
if (s_start == org_str) {