@@ -1917,31 +1917,28 @@ fn append_to_line(cx: &mut Context) {
1918// Creates an LspCallback that waits for formatting changes to be computed. When they're done,
1918// Creates an LspCallback that waits for formatting changes to be computed. When they're done,
1919// it applies them, but only if the doc hasn't changed.
1919// it applies them, but only if the doc hasn't changed.
1920−fn make_format_callback(
1920+async fn make_format_callback(
1921 doc_id: DocumentId,
1921 doc_id: DocumentId,
1922 doc_version: i32,
1922 doc_version: i32,
1923 set_unmodified: bool,
1923 set_unmodified: bool,
1924 format: impl Future<Output = helix_lsp::util::LspFormatting> + Send + 'static,
1924 format: impl Future<Output = helix_lsp::util::LspFormatting> + Send + 'static,
1925−) -> impl Future<Output = anyhow::Result<job::Callback>> {
1925+) -> anyhow::Result<job::Callback> {
1927− let format = format.await;
1926+ let format = format.await;
1928− let call: job::Callback =
1929− Box::new(move |editor: &mut Editor, compositor: &mut Compositor| {
1927+ let call: job::Callback = Box::new(move |editor: &mut Editor, compositor: &mut Compositor| {
1930− let view_id = view!(editor).id;
1928+ let view_id = view!(editor).id;
1931− if let Some(doc) = editor.document_mut(doc_id) {
1929+ if let Some(doc) = editor.document_mut(doc_id) {
1932− if doc.version() == doc_version {
1930+ if doc.version() == doc_version {
1933− doc.apply(&Transaction::from(format), view_id);
1931+ doc.apply(&Transaction::from(format), view_id);
1934− doc.append_changes_to_history(view_id);
1932+ doc.append_changes_to_history(view_id);
1935− if set_unmodified {
1933+ if set_unmodified {
1936− doc.reset_modified();
1934+ doc.reset_modified();
1939− log::info!("discarded formatting changes because the document changed");
1937+ log::info!("discarded formatting changes because the document changed");
1943− Ok(call)
1941+ Ok(call)
1947enum Open {
1944enum Open {