mirror of
https://github.com/marktext/marktext.git
synced 2025-05-19 10:20:54 +08:00
Set CodeMirror viewport to infinity (#1427)
This commit is contained in:
parent
9325486547
commit
1ec2029e39
@ -64,6 +64,12 @@ export default {
|
|||||||
lineWrapping: true,
|
lineWrapping: true,
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
direction: textDirection,
|
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) {
|
lineNumberFormatter (line) {
|
||||||
if (line % 10 === 0 || line === 1) {
|
if (line % 10 === 0 || line === 1) {
|
||||||
return line
|
return line
|
||||||
@ -254,6 +260,7 @@ export default {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.source-code .CodeMirror {
|
.source-code .CodeMirror {
|
||||||
|
height: auto;
|
||||||
margin: 50px auto;
|
margin: 50px auto;
|
||||||
max-width: var(--editorAreaWidth);
|
max-width: var(--editorAreaWidth);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
Loading…
Reference in New Issue
Block a user