mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-25 16:09:44 +00:00
Merge pull request #1494 from zed-industries/do-not-scroll-when-saving
Don't scroll to cursor when performing file save
This commit is contained in:
commit
61684e693f
1 changed files with 1 additions and 4 deletions
|
@ -397,7 +397,7 @@ impl Item for Editor {
|
||||||
let buffers = buffer.read(cx).all_buffers();
|
let buffers = buffer.read(cx).all_buffers();
|
||||||
let mut timeout = cx.background().timer(FORMAT_TIMEOUT).fuse();
|
let mut timeout = cx.background().timer(FORMAT_TIMEOUT).fuse();
|
||||||
let format = project.update(cx, |project, cx| project.format(buffers, true, cx));
|
let format = project.update(cx, |project, cx| project.format(buffers, true, cx));
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|_, mut cx| async move {
|
||||||
let transaction = futures::select_biased! {
|
let transaction = futures::select_biased! {
|
||||||
_ = timeout => {
|
_ = timeout => {
|
||||||
log::warn!("timed out waiting for formatting");
|
log::warn!("timed out waiting for formatting");
|
||||||
|
@ -406,9 +406,6 @@ impl Item for Editor {
|
||||||
transaction = format.log_err().fuse() => transaction,
|
transaction = format.log_err().fuse() => transaction,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.update(&mut cx, |editor, cx| {
|
|
||||||
editor.request_autoscroll(Autoscroll::Fit, cx)
|
|
||||||
});
|
|
||||||
buffer
|
buffer
|
||||||
.update(&mut cx, |buffer, cx| {
|
.update(&mut cx, |buffer, cx| {
|
||||||
if let Some(transaction) = transaction {
|
if let Some(transaction) = transaction {
|
||||||
|
|
Loading…
Reference in a new issue