diff -r 0d42a1ebd954 -r f5921a474d57 src/toolsets/basictoolset.cpp --- a/src/toolsets/basictoolset.cpp Sat Mar 03 15:14:07 2018 +0200 +++ b/src/toolsets/basictoolset.cpp Sat Mar 03 16:53:56 2018 +0200 @@ -98,7 +98,7 @@ { // Get the index of the subfile so we know where to insert the // inlined contents. - QPersistentModelIndex referenceIndex = currentDocument()->index(reference->lineNumber()); + QPersistentModelIndex referenceIndex = currentDocument()->indexOf(reference); int row = referenceIndex.row(); if (referenceIndex.isValid())