@@ -2504,13 +2504,6 @@ fn insert_at_line_end(cx: &mut Context) {
25042504 doc.set_selection(view.id, selection);
25052505}
25062506
2507−/// Sometimes when applying formatting changes we want to mark the buffer as unmodified, for
2508−/// example because we just applied the same changes while saving.
2509−enum Modified {
2510− SetUnmodified,
2511− LeaveModified,
2512−}
2513−
25142507// Creates an LspCallback that waits for formatting changes to be computed. When they're done,
25152508// it applies them, but only if the doc hasn't changed.
25162509//
@@ -2519,7 +2512,6 @@ enum Modified {
25192512async fn make_format_callback(
25202513 doc_id: DocumentId,
25212514 doc_version: i32,
2522− modified: Modified,
25232515 format: impl Future<Output = Result<Transaction, FormatterError>> + Send + 'static,
25242516) -> anyhow::Result<job::Callback> {
25252517 let format = format.await?;
@@ -2536,17 +2528,15 @@ async fn make_format_callback(
25362528 doc.append_changes_to_history(view.id);
25372529 doc.detect_indent_and_line_ending();
25382530 view.ensure_cursor_in_view(doc, scrolloff);
2539− if let Modified::SetUnmodified = modified {
2540− doc.reset_modified();
2541− }
25422531 } else {
25432532 log::info!("discarded formatting changes because the document changed");
25442533 }
25452534 });
2535+
25462536 Ok(call)
25472537}
25482538
2549−#[derive(PartialEq)]
2539+#[derive(PartialEq, Eq)]
25502540pub enum Open {
25512541 Below,
25522542 Above,