Remove into SelectionEffects
from .change_selections
In #32656 I generalized the argument to change selections to allow controling both the scroll and the nav history (and the completion trigger). To avoid conflicting with ongoing debugger cherry-picks I left the argument as an `impl Into<>`, but I think it's clearer to make callers specify what they want here. I converted a lot of `None` arguments to `SelectionEffects::no_scroll()` to be exactly compatible; but I think many people used none as an "i don't care" value in which case Default::default() might be more appropraite
This commit is contained in:
parent
f338c46bf7
commit
28380d714d
65 changed files with 837 additions and 625 deletions
|
@ -4,7 +4,7 @@ use std::{ops::Range, path::PathBuf};
|
|||
|
||||
use anyhow::Result;
|
||||
use editor::scroll::Autoscroll;
|
||||
use editor::{Editor, EditorEvent};
|
||||
use editor::{Editor, EditorEvent, SelectionEffects};
|
||||
use gpui::{
|
||||
App, ClickEvent, Context, Entity, EventEmitter, FocusHandle, Focusable, InteractiveElement,
|
||||
IntoElement, ListState, ParentElement, Render, RetainAllImageCache, Styled, Subscription, Task,
|
||||
|
@ -468,9 +468,12 @@ impl MarkdownPreviewView {
|
|||
) {
|
||||
if let Some(state) = &self.active_editor {
|
||||
state.editor.update(cx, |editor, cx| {
|
||||
editor.change_selections(Some(Autoscroll::center()), window, cx, |selections| {
|
||||
selections.select_ranges(vec![selection])
|
||||
});
|
||||
editor.change_selections(
|
||||
SelectionEffects::scroll(Autoscroll::center()),
|
||||
window,
|
||||
cx,
|
||||
|selections| selections.select_ranges(vec![selection]),
|
||||
);
|
||||
window.focus(&editor.focus_handle(cx));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue