diff --git a/qad_widgets/qcodeedit.cpp b/qad_widgets/qcodeedit.cpp index 4eb4ebd..d78dd0d 100644 --- a/qad_widgets/qcodeedit.cpp +++ b/qad_widgets/qcodeedit.cpp @@ -724,6 +724,8 @@ void QCodeEdit::raiseHelp(QTextCursor tc, int arg) { lbl_help->resize(lbl_help->sizeHint()); lbl_help->move(textCode->mapToGlobal(textCode->cursorRect(tc).topLeft() - QPoint(0, lbl_help->height() + 8))); lbl_help->show(); + cursor_scope = scope.first; + cursor_scope << scope.second; //qDebug() << "tooltip" << st; } @@ -731,6 +733,7 @@ void QCodeEdit::raiseHelp(QTextCursor tc, int arg) { void QCodeEdit::hideHelp() { lbl_help->hide(); es_cursor.cursor = QTextCursor(); + cursor_scope.clear(); applyExtraSelection(); } diff --git a/qad_widgets/qcodeedit.h b/qad_widgets/qcodeedit.h index a2f0f17..d183e04 100644 --- a/qad_widgets/qcodeedit.h +++ b/qad_widgets/qcodeedit.h @@ -38,7 +38,7 @@ public: QRect cursorRect() const {return textCode->cursorRect();} QRect cursorRect(const QTextCursor & cursor) const {return textCode->cursorRect(cursor);} QString text() const {return textCode->toPlainText();} - QString helpWord() const {return es_cursor.cursor.selectedText();} + QStringList cursorScope() const {return cursor_scope;} bool showSpaces() const {return spaces_;} bool showLineNumbers() const {return textLines->isVisible();} @@ -79,6 +79,7 @@ private: QTextEdit::ExtraSelection es_line, es_cursor; QList es_selected, es_custom; QMap ac_classes; + QStringList cursor_scope; int prev_lc, auto_comp_pl, timer; bool spaces_, _ignore_focus_out, _first, _destructor;