Skip to content

Commit 62b8b11

Browse files
committed
fixes to spatial positioning
overly pessimistic collapsing rmeoved
1 parent e611ed0 commit 62b8b11

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

asyncgit/src/graph/buffer.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,6 @@ impl Buffer {
148148
}
149149

150150
fn flush_merge_commits(&mut self) {
151-
// Collect available empty lanes once, before we start maybe filling them.
152-
let mut empty_lanes: Vec<usize> = self
153-
.current
154-
.iter()
155-
.enumerate()
156-
.filter_map(|(index, slot)| {
157-
slot.is_none().then_some(index)
158-
})
159-
.collect();
160-
161151
while let Some(alias) = self.merge_commits.pop() {
162152
// Search for an occupied slot that matches the target alias.
163153
// If found, extract its index and a mutable clone of the chunk.
@@ -184,14 +174,14 @@ impl Buffer {
184174
marker: Markers::Commit,
185175
};
186176

187-
if let Some(empty_index) = empty_lanes.pop() {
188-
self.record_replace(empty_index, Some(new_lane));
189-
} else {
190-
self.record_insert(
191-
self.current.len(),
192-
Some(new_lane),
193-
);
194-
}
177+
// Always append the merge's second-parent lane to
178+
// the end instead of reusing an existing empty slot,
179+
// so the new visual column does not collapse
180+
// spatial ordering of lanes already in existence.
181+
self.record_insert(
182+
self.current.len(),
183+
Some(new_lane),
184+
);
195185
}
196186
}
197187
}

0 commit comments

Comments
 (0)