Scroll project diff into view always (#26379)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
e513e81046
commit
73dfb10c16
2 changed files with 7 additions and 0 deletions
|
@ -749,6 +749,7 @@ impl GitPanel {
|
|||
.as_ref()
|
||||
{
|
||||
project_diff.focus_handle(cx).focus(window);
|
||||
project_diff.update(cx, |project_diff, cx| project_diff.autoscroll(cx));
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,6 +125,12 @@ impl ProjectDiff {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn autoscroll(&self, cx: &mut Context<Self>) {
|
||||
self.editor.update(cx, |editor, cx| {
|
||||
editor.request_autoscroll(Autoscroll::fit(), cx);
|
||||
})
|
||||
}
|
||||
|
||||
fn new(
|
||||
project: Entity<Project>,
|
||||
workspace: Entity<Workspace>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue