style: cargo fmt over the optimistic-editing arc
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
2339a10b03
commit
e8b5b94a4d
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue