avoid completion on empty lines

This commit is contained in:
Axel Kohlmeyer
2023-10-13 06:18:56 -04:00
parent 2629136958
commit 926de1575c

View File

@ -568,6 +568,7 @@ void CodeEditor::keyPressEvent(QKeyEvent *event)
if (automatic_completion) {
auto cursor = textCursor();
auto line = cursor.block().text();
if (line.isEmpty()) return;
// QTextCursor::WordUnderCursor is unusable here since recognizes '/' as word boundary.
// Work around it by manually searching for the location of the beginning of the word.