Skip to content

Commit 912e7a4

Browse files
committed
fix: Correctly pick whole file context
Currently the current line is duplicated in both "before" and "after" context. This is due to DocumentContextReader::readWholeFileAfter() picking the current line part of which has been already included into the "before" context.
1 parent 61196ca commit 912e7a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

context/DocumentContextReader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ QString DocumentContextReader::readWholeFileBefore(int lineNumber, int cursorPos
115115

116116
QString DocumentContextReader::readWholeFileAfter(int lineNumber, int cursorPosition) const
117117
{
118-
return getContextBetween(lineNumber, m_document->blockCount() - 1, cursorPosition);
118+
return getContextBetween(lineNumber + 1, m_document->blockCount() - 1, cursorPosition);
119119
}
120120

121121
QString DocumentContextReader::getLanguageAndFileInfo() const

0 commit comments

Comments
 (0)