Set CodeMirror viewport to infinity (#1427)

This commit is contained in:
Felix Häusler 2019-10-02 03:17:41 +02:00 committed by Ran Luo
parent 9325486547
commit 1ec2029e39

View File

@ -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;