snippets: Show completions on first range in tabstop instead of last (#31939)
Release Notes: - N/A
This commit is contained in:
parent
6d66ff1d95
commit
beeb42da29
1 changed files with 4 additions and 2 deletions
|
@ -8970,7 +8970,9 @@ impl Editor {
|
|||
})
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
tabstop_ranges.sort_unstable_by(|a, b| a.start.cmp(&b.start, snapshot));
|
||||
// Sort in reverse order so that the first range is the newest created
|
||||
// selection. Completions will use it and autoscroll will prioritize it.
|
||||
tabstop_ranges.sort_unstable_by(|a, b| b.start.cmp(&a.start, snapshot));
|
||||
|
||||
Tabstop {
|
||||
is_end_tabstop,
|
||||
|
@ -9098,7 +9100,7 @@ impl Editor {
|
|||
}
|
||||
if let Some(current_ranges) = snippet.ranges.get(snippet.active_index) {
|
||||
self.change_selections(Some(Autoscroll::fit()), window, cx, |s| {
|
||||
s.select_anchor_ranges(current_ranges.iter().cloned())
|
||||
s.select_ranges(current_ranges.iter().cloned())
|
||||
});
|
||||
|
||||
if let Some(choices) = &snippet.choices[snippet.active_index] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue