menu/editor: Accept and insert tabs from keyboard input
diff --git a/common/lib/getchar.c b/common/lib/getchar.c
index 014d9a95..8a611718 100644
--- a/common/lib/getchar.c
+++ b/common/lib/getchar.c
@@ -78,6 +78,8 @@ int getchar_internal(uint8_t scancode, uint8_t ascii, uint32_t shift_state) {
return '\n';
case '\b':
return '\b';
+ case '\t':
+ return '\t';
}
if (shift_state & (GETCHAR_LCTRL | GETCHAR_RCTRL)) {
diff --git a/common/menu.c b/common/menu.c
index 2792cf26..0fef4ce8 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -488,7 +488,7 @@ refresh:
return NULL;
default:
if (buffer_len < EDITOR_MAX_BUFFER_SIZE - 1) {
- if (isprint(c) || c == '\n') {
+ if (isprint(c) || c == '\n' || c == '\t') {
for (size_t i = buffer_len; ; i--) {
buffer[i+1] = buffer[i];
if (i == cursor_offset)
