Skip to content

Commit bf99f9b

Browse files
committed
Clean: wrap lines.
1 parent acde1ed commit bf99f9b

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

client/src/CodeMirror-integration.mts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ export const docBlockField = StateField.define<DecorationSet>({
290290
prev.spec.widget.contents,
291291
effect.value.contents,
292292
),
293-
// If autosave is allowed (meaning no autosave is not true), then this data came from the user, not the IDE.
293+
// If autosave is allowed (meaning no autosave
294+
// is not true), then this data came from the
295+
// user, not the IDE.
294296
tr.annotation(noAutosaveAnnotation) !== true,
295297
),
296298
...decorationOptions,
@@ -688,7 +690,9 @@ export const DocBlockPlugin = ViewPlugin.fromClass(
688690
return;
689691
}
690692

691-
// TODO: current, posToDom never gives us a doc block, even when the from/to is correct. So, we never get here.
693+
// TODO: current, posToDom never gives us a doc
694+
// block, even when the from/to is correct. So, we
695+
// never get here.
692696
(dom.childNodes[1] as HTMLElement).focus();
693697
},
694698
);
@@ -760,7 +764,8 @@ export const DocBlockPlugin = ViewPlugin.fromClass(
760764
// cursor position (the selection) to be set in the
761765
// contenteditable div. Then, save that location.
762766
setTimeout(async () => {
763-
// Before untypesetting, make sure all other typesets finish.
767+
// Before untypesetting, make sure all other typesets
768+
// finish.
764769
await new Promise((resolve) =>
765770
window.MathJax.whenReady(resolve(undefined)),
766771
);
@@ -1033,11 +1038,14 @@ export const CodeMirror_load = async (
10331038
setup: (editor: Editor) => {
10341039
// See the
10351040
// [docs](https://www.tiny.cloud/docs/tinymce/latest/events/#editor-core-events).
1036-
// This is triggered on edits (just as the `input` event), but also when applying formatting changes, inserting images, etc. that the above callback misses.
1041+
// This is triggered on edits (just as the `input` event), but
1042+
// also when applying formatting changes, inserting images, etc.
1043+
// that the above callback misses.
10371044
editor.on(
10381045
"Dirty",
10391046
(event: EditorEvent<Events.EditorEventMap["dirty"]>) => {
1040-
// Sometimes, `tinymce.activeEditor` is null (perhaps when it's not focused). Use the `event` data instead.
1047+
// Sometimes, `tinymce.activeEditor` is null (perhaps
1048+
// when it's not focused). Use the `event` data instead.
10411049
event.target.setDirty(false);
10421050
// Get the div TinyMCE stores edits in.
10431051
const target_or_false = event.target.bodyElement;

server/src/translation.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,15 +1229,17 @@ fn compare_html(
12291229
.map(|c: char| if c == '\n' { ' ' } else { c })
12301230
}
12311231

1232-
// Normalized `<br>` elements are followed by a newline; raw `<br>` elements aren't. Remove the newline.
1232+
// Normalized `<br>` elements are followed by a newline; raw `<br>` elements
1233+
// aren't. Remove the newline.
12331234
let fixed_normalized_html = normalized_html.replace("<br>\n", "<br>");
12341235

12351236
// Transforming the HTML with an empty transform normalizes it but leave it
12361237
// otherwise unchanged.
12371238
if let Ok(normalized_raw_html) = transform_html(raw_html, |_node| {}) {
12381239
// Ignore word wrapping and leading/trailing whitespace in the
12391240
// comparison.
1240-
map_newlines_to_spaces(&fixed_normalized_html).eq(map_newlines_to_spaces(&normalized_raw_html))
1241+
map_newlines_to_spaces(&fixed_normalized_html)
1242+
.eq(map_newlines_to_spaces(&normalized_raw_html))
12411243
} else {
12421244
false
12431245
}

server/src/webserver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,9 @@ pub struct UpdateMessageContents {
348348
#[serde(skip_serializing_if = "Option::is_none")]
349349
pub scroll_position: Option<f32>,
350350
/// True if this is a re-translation, which can be ignored if the receiver's
351-
/// document is dirty. Therefore, this is written by the IDE and read by the Client and IDE; conversely, it's ignored by the Server. The IDE and Client should set this value to false.
351+
/// document is dirty. Therefore, this is written by the IDE and read by the
352+
/// Client and IDE; conversely, it's ignored by the Server. The IDE and
353+
/// Client should set this value to false.
352354
pub is_re_translation: bool,
353355
/// The contents of this file.
354356
#[serde(skip_serializing_if = "Option::is_none")]

0 commit comments

Comments
 (0)