From 1ec2029e394857072ec6657a62a42f9883ab3a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20H=C3=A4usler?= Date: Wed, 2 Oct 2019 03:17:41 +0200 Subject: [PATCH] Set CodeMirror viewport to infinity (#1427) --- src/renderer/components/editorWithTabs/sourceCode.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderer/components/editorWithTabs/sourceCode.vue b/src/renderer/components/editorWithTabs/sourceCode.vue index b84093c3..9ce2943c 100644 --- a/src/renderer/components/editorWithTabs/sourceCode.vue +++ b/src/renderer/components/editorWithTabs/sourceCode.vue @@ -64,6 +64,12 @@ export default { lineWrapping: true, styleActiveLine: true, direction: textDirection, + // The amount of updates needed when scrolling. Settings this to >Infinity< or use CSS + // >height: auto< result in bad performance because the whole document is always rendered. + // Since we are using >height: auto< setting this to >Infinity< to fix #171. The best + // solution would be to set a fixed height like in #791 but then the scrollbar is not on + // the right side. Please also see CodeMirror#1104. + viewportMargin: Infinity, lineNumberFormatter (line) { if (line % 10 === 0 || line === 1) { return line @@ -254,6 +260,7 @@ export default { overflow: auto; } .source-code .CodeMirror { + height: auto; margin: 50px auto; max-width: var(--editorAreaWidth); background: transparent;