Commit b1230182 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Fix blame with selection that ends on the last line



This also removes an additional line when the cursor is on a line start.

Change-Id: Iaec6f60b8e33d98c3a3ed0555ee4ff01991ad7fb
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 3e214a2e
......@@ -716,9 +716,11 @@ void GitPlugin::blameFile()
cursor.setPosition(selectionStart);
const int startBlock = cursor.blockNumber();
cursor.setPosition(selectionEnd);
const int endBlock = cursor.blockNumber();
int endBlock = cursor.blockNumber();
if (startBlock != endBlock) {
firstLine = startBlock + 1;
if (cursor.atBlockStart())
--endBlock;
if (auto widget = qobject_cast<VcsBaseEditorWidget *>(textEditor->widget())) {
const int previousFirstLine = widget->firstLineNumber();
if (previousFirstLine > 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment