Commit 007d40fd authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Don't activate notes for uncommitted lines

parent e50c8655
......@@ -31,6 +31,11 @@
#include <QPainter>
#include <QVariant>
static bool isUncomittedLine(const QByteArray &hash)
{
return hash == "hash" || hash == "0000000000000000000000000000000000000000";
}
GitBlameInlineNoteProvider::GitBlameInlineNoteProvider(KateGitBlamePluginView *pluginView)
: KTextEditor::InlineNoteProvider()
, m_pluginView(pluginView)
......@@ -112,6 +117,10 @@ void GitBlameInlineNoteProvider::inlineNoteActivated(const KTextEditor::InlineNo
int lineNr = note.position().line();
const CommitInfo &info = m_pluginView->blameInfo(lineNr);
if (isUncomittedLine(info.hash)) {
return;
}
// Hack: view->mainWindow()->view() to de-constify view
Q_ASSERT(note.view() == m_pluginView->activeView());
m_pluginView->showCommitInfo(QString::fromUtf8(info.hash), note.view()->mainWindow()->activeView());
......
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