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
8c1ad98d
Commit
8c1ad98d
authored
Dec 22, 2021
by
Waqar Ahmed
Browse files
Fix incorrect blame info parsing when summary has '\t'
parent
3b75f706
Pipeline
#113233
passed with stage
in 3 minutes and 16 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/git-blame/kategitblameplugin.cpp
View file @
8c1ad98d
...
...
@@ -269,6 +269,21 @@ void KateGitBlamePluginView::showCommitInfo(const QString &hash, KTextEditor::Vi
startShowProcess
(
view
->
document
()
->
url
(),
hash
);
}
static
int
nextBlockStart
(
const
QByteArray
&
out
,
int
from
)
{
int
next
=
out
.
indexOf
(
'\t'
,
from
);
// tab must be the first character in line for next block
if
(
next
>
0
&&
out
[
next
-
1
]
!=
'\n'
)
{
next
++
;
// move forward one line
next
=
out
.
indexOf
(
'\n'
,
next
);
// try to look for another tab char
next
=
out
.
indexOf
(
'\t'
,
next
);
// if not found => end
}
return
next
;
}
void
KateGitBlamePluginView
::
blameFinished
(
int
/*exitCode*/
,
QProcess
::
ExitStatus
/*exitStatus*/
)
{
QByteArray
out
=
m_blameInfoProc
.
readAllStandardOutput
();
...
...
@@ -333,7 +348,7 @@ void KateGitBlamePluginView::blameFinished(int /*exitCode*/, QProcess::ExitStatu
m_blamedLines
.
back
().
lineText
=
out
.
mid
(
from
,
pos
-
from
);
start
=
next
+
1
;
next
=
out
.
indexOf
(
'\t'
,
start
);
next
=
nextBlockStart
(
out
,
start
);
if
(
next
==
-
1
)
break
;
next
=
out
.
indexOf
(
'\n'
,
next
);
...
...
@@ -387,7 +402,7 @@ void KateGitBlamePluginView::blameFinished(int /*exitCode*/, QProcess::ExitStatu
m_blamedLines
.
back
().
lineText
=
out
.
mid
(
from
,
pos
-
from
);
start
=
next
+
1
;
next
=
out
.
indexOf
(
'\t'
,
start
);
next
=
nextBlockStart
(
out
,
start
);
if
(
next
==
-
1
)
break
;
next
=
out
.
indexOf
(
'\n'
,
next
);
...
...
Waqar Ahmed
@waqar
mentioned in commit
5ad03fcf
·
Dec 24, 2021
mentioned in commit
5ad03fcf
mentioned in commit 5ad03fcf6225294ab9342d3cb63994b571dbac06
Toggle commit list
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