Macro IDE: completer catches more words

This commit is contained in:
Matthias Koefferlein 2021-06-09 22:44:07 +02:00
parent a4039a1bf8
commit c661db8279
1 changed files with 9 additions and 0 deletions

View File

@ -652,6 +652,15 @@ void MacroEditorPage::fill_completer_list ()
int pos = c.anchor ();
c.select (QTextCursor::WordUnderCursor);
int pos0 = c.selectionStart ();
if (pos0 >= pos) {
// if there is no word before, move to left to catch one
c = mp_text->textCursor ();
c.movePosition (QTextCursor::WordLeft, QTextCursor::KeepAnchor);
pos = c.anchor ();
pos0 = c.selectionStart ();
}
if (pos0 >= pos) {
return;
}