Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
007d40fd
Commit
007d40fd
authored
Jan 05, 2022
by
Waqar Ahmed
Browse files
Don't activate notes for uncommitted lines
parent
e50c8655
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/git-blame/kategitblameplugin.cpp
View file @
007d40fd
...
...
@@ -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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment