From 72db77ae7c3c48f5ea75cd56700436ecb4e1266f Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 27 Aug 2026 12:43:22 +0100 Subject: [PATCH] Allow inserting tabs at the start of the REPL input * If there is no non-whitespace input, we shouldn't try to autocomplete --- qrenderdoc/Windows/PythonShell.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 70cf2e597..07b65eae8 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -2229,9 +2229,17 @@ void PythonShell::interactive_keypress(QKeyEvent *event) { // manually trigger a completion with tab case Qt::Key_Tab: - m_InteractiveCompleter->activated( - m_InteractiveCompleter->popup()->selectionModel()->currentIndex()); - m_InteractiveCompleter->popup()->hide(); + // allow prefixed tabs to be inserted + if(ui->lineInput->text().trimmed().isEmpty()) + { + ui->lineInput->insert(lit("\t")); + } + else + { + m_InteractiveCompleter->activated( + m_InteractiveCompleter->popup()->selectionModel()->currentIndex()); + m_InteractiveCompleter->popup()->hide(); + } return; // if a completion is in progress ignore any events the completer will process case Qt::Key_Return: