mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
blob: Fix missing blame decoration (#58129)
The hunks should be compared by identity, not revision. I think I was exploring comparing by revision in order to avoid showing the same decoration for consecutive hunks, but that had other UI issues.
This commit is contained in:
parent
baa50d7455
commit
1fe96cf934
@ -176,7 +176,7 @@ class BlameDecorationViewPlugin implements PluginValue {
|
||||
const builder = new RangeSetBuilder<Decoration>()
|
||||
|
||||
// Keeps track of the last found hunk. We don't want to show an additional blame
|
||||
// decoration when a range inside a single hunk is shown.
|
||||
// decoration when a range inside a single hunk is folded.
|
||||
let previousHunk: BlameHunk | undefined
|
||||
|
||||
for (const { from, to } of view.visibleRanges) {
|
||||
@ -188,7 +188,7 @@ class BlameDecorationViewPlugin implements PluginValue {
|
||||
const endLine = view.state.doc.lineAt(to).number
|
||||
while (line.number <= endLine) {
|
||||
const matchingHunk = lines[line.number]
|
||||
if (matchingHunk && matchingHunk.rev !== previousHunk?.rev) {
|
||||
if (matchingHunk && matchingHunk !== previousHunk) {
|
||||
if (line.number !== 1) {
|
||||
builder.add(line.from, line.from, startOfHunkDecoration)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user