forked from qt-creator/qt-creator
Git: Limit blame range only for multiple lines selection
Selecting a word should not result in a single line blame... Change-Id: I03e8b75c519eb555b77985e7c68b3429bfff9446 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
6a8d6296b1
commit
7a5b45bdc2
@@ -679,17 +679,19 @@ void GitPlugin::blameFile()
|
||||
int selectionEnd = cursor.selectionEnd();
|
||||
cursor.setPosition(selectionStart);
|
||||
const int startBlock = cursor.blockNumber();
|
||||
firstLine = startBlock + 1;
|
||||
if (auto widget = qobject_cast<VcsBaseEditorWidget *>(textEditor->widget())) {
|
||||
const int previousFirstLine = widget->firstLineNumber();
|
||||
if (previousFirstLine > 0)
|
||||
firstLine = previousFirstLine;
|
||||
}
|
||||
argument += QString::number(firstLine) + ',';
|
||||
cursor.setPosition(selectionEnd);
|
||||
const int endBlock = cursor.blockNumber();
|
||||
argument += QString::number(endBlock + firstLine - startBlock);
|
||||
extraOptions << argument;
|
||||
if (startBlock != endBlock) {
|
||||
firstLine = startBlock + 1;
|
||||
if (auto widget = qobject_cast<VcsBaseEditorWidget *>(textEditor->widget())) {
|
||||
const int previousFirstLine = widget->firstLineNumber();
|
||||
if (previousFirstLine > 0)
|
||||
firstLine = previousFirstLine;
|
||||
}
|
||||
argument += QString::number(firstLine) + ',';
|
||||
argument += QString::number(endBlock + firstLine - startBlock);
|
||||
extraOptions << argument;
|
||||
}
|
||||
}
|
||||
}
|
||||
VcsBaseEditorWidget *editor = m_gitClient->annotate(
|
||||
|
Reference in New Issue
Block a user