lib/mp-readline: Add auto-indent support.
4 spaces are added at start of line to match previous indent, and if
previous line ended in colon.
Backspace deletes 4 space if only spaces begin a line.
Configurable via MICROPY_REPL_AUTO_INDENT. Disabled by default.
diff --git a/py/mpconfig.h b/py/mpconfig.h
index ce6fa6c..eb5b724 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -302,6 +302,11 @@
#define MICROPY_REPL_EMACS_KEYS (0)
#endif
+// Whether to implement auto-indent in REPL
+#ifndef MICROPY_REPL_AUTO_INDENT
+#define MICROPY_REPL_AUTO_INDENT (0)
+#endif
+
// Whether port requires event-driven REPL functions
#ifndef MICROPY_REPL_EVENT_DRIVEN
#define MICROPY_REPL_EVENT_DRIVEN (0)