diff options
author | Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> | 2023-06-17 15:12:45 -0400 |
---|---|---|
committer | Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> | 2023-06-17 15:12:45 -0400 |
commit | 567c45be1222b753f9854a081dbd934edd22ab53 (patch) | |
tree | 55a0667f54e855afa2e8d67d38f21b7414a14c4e | |
parent | 59a53d541989d059215dc88a32dc1a69d902b9d4 (diff) | |
download | compiler-explorer-gh-7789.tar.gz compiler-explorer-gh-7789.zip |
Fix word wrapping buggh-7789
-rw-r--r-- | static/panes/editor.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/static/panes/editor.ts b/static/panes/editor.ts index 59e17c27a..388ec1bde 100644 --- a/static/panes/editor.ts +++ b/static/panes/editor.ts @@ -1225,8 +1225,12 @@ export class Editor extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Edit // Only update the options if needed if (this.settings.wordWrap) { - this.editor.updateOptions({ - wordWrapColumn: this.editor.getLayoutInfo().viewportColumn, + // super.resize is going to _.defer, so we also _.defer to get those updates + // This fixes https://github.com/compiler-explorer/compiler-explorer/issues/4486 + _.defer(() => { + this.editor.updateOptions({ + wordWrapColumn: this.editor.getLayoutInfo().viewportColumn, + }); }); } } |