C++ function links: Use line+column instead of offset for target.

It's more robust if text before the target is changed in a minor way.

Change-Id: I48e27c5d194dd2dcff4b064bf59538b4660015d7
Reviewed-on: http://codereview.qt.nokia.com/3097
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-17 14:11:35 +02:00
parent 8a6d767a8f
commit 6235ec5120
2 changed files with 25 additions and 10 deletions

View File

@@ -89,10 +89,12 @@ public:
void apply(CPPEditorWidget *editor, bool jumpToMatch);
void hideMarker(CPPEditorWidget *editor);
void showMarker(CPPEditorWidget *editor);
Utils::ChangeSet changes(const CPlusPlus::Snapshot &snapshot);
Utils::ChangeSet changes(const CPlusPlus::Snapshot &snapshot, int targetOffset = -1);
QTextCursor linkSelection;
int targetOffset;
// 1-based line and column
unsigned targetLine;
unsigned targetColumn;
QString targetInitial;
CPlusPlus::Document::Ptr sourceDocument;