diff --git a/pmacs-gpu/src/main.rs b/pmacs-gpu/src/main.rs index 44f57e5..923a542 100644 --- a/pmacs-gpu/src/main.rs +++ b/pmacs-gpu/src/main.rs @@ -925,7 +925,10 @@ impl State { let delta_batches = self.loro_text_delta_batches.clone()?; clear_loro_text_delta_batches(&delta_batches); let before = doc.oplog_vv(); - if let Err(e) = doc.get_text(LORO_TEXT_CONTAINER).insert_utf8(cursor, insert) { + if let Err(e) = doc + .get_text(LORO_TEXT_CONTAINER) + .insert_utf8(cursor, insert) + { eprintln!("pmacs-gpu: optimistic insert failed: {e:?}"); return None; } diff --git a/src/process.rs b/src/process.rs index 0b88352..307d56c 100644 --- a/src/process.rs +++ b/src/process.rs @@ -491,8 +491,9 @@ impl StdinWriter { let result = sink.write_all(&bytes).and_then(|()| sink.flush()); thread_queued.fetch_sub(bytes.len(), Ordering::Relaxed); if let Err(e) = result { - *thread_error.lock().expect("stdin writer error mutex poisoned") = - Some(e.to_string()); + *thread_error + .lock() + .expect("stdin writer error mutex poisoned") = Some(e.to_string()); return; } } diff --git a/tests/cua_region_acceptance.rs b/tests/cua_region_acceptance.rs index 26eec00..e7e6676 100644 --- a/tests/cua_region_acceptance.rs +++ b/tests/cua_region_acceptance.rs @@ -60,7 +60,10 @@ fn backspace_deletes_the_shift_selected_region() { let (_, region_active, _) = probe(&s); assert!(region_active, "shift+arrows must leave an active region"); - s.dispatch_key(FrontendId::LOCAL, key(KeyCode::Backspace, KeyModifiers::NONE)); + s.dispatch_key( + FrontendId::LOCAL, + key(KeyCode::Backspace, KeyModifiers::NONE), + ); let (text, region_active, cursor) = probe(&s); assert_eq!(text, "he", "backspace must delete the whole region"); @@ -68,7 +71,10 @@ fn backspace_deletes_the_shift_selected_region() { assert_eq!(cursor, 2, "cursor lands at the deleted region's start"); // Without a region, backspace keeps single-codepoint semantics. - s.dispatch_key(FrontendId::LOCAL, key(KeyCode::Backspace, KeyModifiers::NONE)); + s.dispatch_key( + FrontendId::LOCAL, + key(KeyCode::Backspace, KeyModifiers::NONE), + ); let (text, _, cursor) = probe(&s); assert_eq!(text, "h", "no region ⇒ plain single-codepoint backspace"); assert_eq!(cursor, 1); @@ -87,7 +93,10 @@ fn ctrl_backspace_deletes_the_previous_word() { key(KeyCode::Backspace, KeyModifiers::CONTROL), ); let (text, _, cursor) = probe(&s); - assert_eq!(text, "alpha ", "C-BS deletes back through the previous word"); + assert_eq!( + text, "alpha ", + "C-BS deletes back through the previous word" + ); assert_eq!(cursor, 6); s.dispatch_key(FrontendId::LOCAL, key(KeyCode::Left, KeyModifiers::CONTROL)); diff --git a/tests/m4_acceptance.rs b/tests/m4_acceptance.rs index b7cc9d9..9e1dfd9 100644 --- a/tests/m4_acceptance.rs +++ b/tests/m4_acceptance.rs @@ -5230,8 +5230,14 @@ fn m4_lua_bundle_debounces_did_change_per_keystroke() { ) .eval() .expect("flush + count"); - assert_eq!(sent, 1, "explicit flush ships exactly one coalesced didChange"); - assert_eq!(version, 4, "flush carries the latest version (v1 open + 3 edits)"); + assert_eq!( + sent, 1, + "explicit flush ships exactly one coalesced didChange" + ); + assert_eq!( + version, 4, + "flush carries the latest version (v1 open + 3 edits)" + ); // Time-based flush: one more edit, then tick after the quiet // window (75ms in the bundle) has elapsed.