Created attachment 118445 [details] tentative fix SUMMARY It is possible (and often too easy) to insert an unwanted entry from the code completion popup, i.e. some unforeseen entry that gets inserted under the cursor *after* you hit the Enter key but before that event is processed. Sometimes I even get the result of an entirely unexpected code completion when the popup appears just before my tap on the Enter key lands or the keypress gets registered. STEPS TO REPRODUCE 1. Activate automatic appearance of the completion popup OBSERVED RESULT As described in the summary, happening more frequently with documents with lots of headers and code that leads to long lists with completion candidates. I can't affirm that it happens more often on my slower machine than on my faster machine but it does happen more often when I'm keeping the machine busy (and is elusive when you want to trigger it). EXPECTED RESULT Deterministic behaviour... SOFTWARE/OS VERSIONS KDE Frameworks Version: 5.52.0 Qt Version: 5.9.7 ADDITIONAL INFORMATION A few possible solutions: - a user-configurable "select this entry" would prevent accidental code completion when all you want is just enter a newline - make it impossible to accept an entry from the list if the list isn't yet complete OR - activate the feature only when the list is complete. I'm attaching a tiny patch that appears to achieve the latter solution by using the waitForReset signal.