Fix GoToDefinition changing the viewport unnecessarily (#18441)
Closes #10738. Release Notes: - Fixed `GoToDefinition` changing the viewport (scrolling up/down) even when the definition is already within the viewport. ([#10738](https://github.com/zed-industries/zed/issues/10738))
This commit is contained in:
parent
03c7f08581
commit
dc5ffe6994
1 changed files with 1 additions and 1 deletions
|
@ -9697,7 +9697,7 @@ impl Editor {
|
|||
if Some(&target.buffer) == editor.buffer.read(cx).as_singleton().as_ref() {
|
||||
let buffer = target.buffer.read(cx);
|
||||
let range = check_multiline_range(buffer, range);
|
||||
editor.change_selections(Some(Autoscroll::focused()), cx, |s| {
|
||||
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
|
||||
s.select_ranges([range]);
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue