Skip to content

Commit 58807e3

Browse files
committed
Clean: wrap lines.
1 parent 2895d44 commit 58807e3

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Structure
2525
---------
2626

2727
The CodeChat Editor divides source code into code blocks and documentation (doc)
28-
blocks. These blocks are separated by newlines; the image below shows the
29-
[style guide](docs/style_guide.cpp) on the left in the Visual Studio Code
30-
(VSCode) text editor, while the right pane shows the same text from style guide
31-
in the CodeChat Editor (using the VSCode extension). Specifically, this
32-
screenshot shows:
28+
blocks. These blocks are separated by newlines; the image below shows the [style
29+
guide](docs/style_guide.cpp) on the left in the Visual Studio Code (VSCode) text
30+
editor, while the right pane shows the same text from style guide in the
31+
CodeChat Editor (using the VSCode extension). Specifically, this screenshot
32+
shows:
3333

3434
* <span style="font-size: 20pt;">❶</span>: a doc block. Doc blocks must have
3535
one space after the comment delimiter.
@@ -140,7 +140,8 @@ following characters should be escaped: `*`, `_`, `\`, `[`, `]`, `<`.
140140
| `$3 <a> b$` | $3 <a>b$</a> | `$3 \<a> b$` | $3 \<a> b$ |
141141
| `$a \; b$` | $a \; b$ | `$a \\; b$` | $a \\; b$ |
142142

143-
## Diagrams
143+
Diagrams
144+
--------
144145

145146
### Graphviz
146147

client/src/CodeMirror-integration.mts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ class DocBlockWidget extends WidgetType {
442442
// "Update a DOM element created by a widget of the same type (but
443443
// different, non-eq content) to reflect this widget."
444444
updateDOM(dom: HTMLElement, view: EditorView): boolean {
445-
// See if this update was produced by a change in TinyMCE text, which means the DOM is already updated.
445+
// See if this update was produced by a change in TinyMCE text, which
446+
// means the DOM is already updated.
446447
if ((dom as any).update_complete === true) {
447448
// Yes, so clear this update flag before returning.
448449
delete (dom as any).update_complete;
@@ -586,7 +587,10 @@ const on_dirty = (
586587
const indent = indent_div.innerHTML;
587588
const delimiter = indent_div.getAttribute("data-delimiter")!;
588589
const [contents_div, is_tinymce] = get_contents(target);
589-
// Sorta ugly hack: TinyMCE stores its date in the DOM. CodeMirror stores state in external structs. We need to update the CodeMirror state, but not overwrite the DOM with this "new" state, since the DOM is already updated. So, signal that this "update" is already done.
590+
// Sorta ugly hack: TinyMCE stores its date in the DOM. CodeMirror stores
591+
// state in external structs. We need to update the CodeMirror state, but
592+
// not overwrite the DOM with this "new" state, since the DOM is already
593+
// updated. So, signal that this "update" is already done.
590594
(target as any).update_complete = true;
591595
tinymce_singleton!.save();
592596
const contents = is_tinymce
@@ -624,23 +628,26 @@ export const DocBlockPlugin = ViewPlugin.fromClass(
624628
main_selection.from,
625629
main_selection.to,
626630
(from: number, to: number, value: Decoration) => {
627-
// Is this range contained within this doc block? If the ranges also contains element outside it, then don't capture focus. TODO: not certain on the bounds -- should I use \<= or \<, etc.?
631+
// Is this range contained within this doc block? If
632+
// the ranges also contains element outside it, then
633+
// don't capture focus. TODO: not certain on the
634+
// bounds -- should I use <= or <, etc.?
628635
if (
629636
main_selection.from < from ||
630637
main_selection.to > main_selection.to
631638
) {
632639
return;
633640
}
634641

635-
// Ensure we have a valid dom. This also checks for undefined.
642+
// Ensure we have a valid dom. This also checks for
643+
// undefined.
636644
const dom_at_pos = update.view.domAtPos(from);
637645
const dom = dom_at_pos.node.childNodes[dom_at_pos.offset] as HTMLDivElement | null;
638646
if (dom == null) {
639647
return;
640648
}
641649

642-
// Give focus to the contents of the doc
643-
// block.
650+
// Give focus to the contents of the doc block.
644651
(dom.childNodes[1] as HTMLElement).focus();
645652
},
646653
);

0 commit comments

Comments
 (0)