WIP: Add keybinding to open buffers under cursors

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2022-01-07 16:12:50 +01:00
co-authored by Nathan Sobo
parent cf62d26ed8
commit 3cab32d201
7 changed files with 70 additions and 15 deletions
+3 -2
View File
@@ -1105,7 +1105,7 @@ impl Editor {
T: ToOffset,
{
let buffer = self.buffer.read(cx).snapshot(cx);
let selections = ranges
let mut selections = ranges
.into_iter()
.map(|range| {
let mut start = range.start.to_offset(&buffer);
@@ -1124,7 +1124,8 @@ impl Editor {
goal: SelectionGoal::None,
}
})
.collect();
.collect::<Vec<_>>();
selections.sort_unstable_by_key(|s| s.start);
self.update_selections(selections, autoscroll, cx);
}