@@ -2504,13 +2504,6 @@ fn insert_at_line_end(cx: &mut Context) {
2504 doc.set_selection(view.id, selection);
2504 doc.set_selection(view.id, selection);
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.
2514// Creates an LspCallback that waits for formatting changes to be computed. When they're done,
2507// Creates an LspCallback that waits for formatting changes to be computed. When they're done,
2515// it applies them, but only if the doc hasn't changed.
2508// it applies them, but only if the doc hasn't changed.
@@ -2519,7 +2512,6 @@ enum Modified {
2519async fn make_format_callback(
2512async fn make_format_callback(
2520 doc_id: DocumentId,
2513 doc_id: DocumentId,
2521 doc_version: i32,
2514 doc_version: i32,
2522− modified: Modified,
2523 format: impl Future<Output = Result<Transaction, FormatterError>> + Send + 'static,
2515 format: impl Future<Output = Result<Transaction, FormatterError>> + Send + 'static,
2524) -> anyhow::Result<job::Callback> {
2516) -> anyhow::Result<job::Callback> {
2525 let format = format.await?;
2517 let format = format.await?;
@@ -2536,17 +2528,15 @@ async fn make_format_callback(
2536 doc.append_changes_to_history(view.id);
2528 doc.append_changes_to_history(view.id);
2537 doc.detect_indent_and_line_ending();
2529 doc.detect_indent_and_line_ending();
2538 view.ensure_cursor_in_view(doc, scrolloff);
2530 view.ensure_cursor_in_view(doc, scrolloff);
2539− if let Modified::SetUnmodified = modified {
2540− doc.reset_modified();
2542 } else {
2531 } else {
2543 log::info!("discarded formatting changes because the document changed");
2532 log::info!("discarded formatting changes because the document changed");
2546 Ok(call)
2536 Ok(call)
2549−#[derive(PartialEq)]
2539+#[derive(PartialEq, Eq)]
2550pub enum Open {
2540pub enum Open {