()
| 853 | } |
| 854 | |
| 855 | getFontSizeExtension(): Extension { |
| 856 | // 使用 EditorView.theme 统一设置所有元素的字体大小和行高 |
| 857 | const lineHeight = 1.5; |
| 858 | return EditorView.theme({ |
| 859 | "&": { |
| 860 | fontSize: `${this.fontSize}px` |
| 861 | }, |
| 862 | ".cm-content": { |
| 863 | fontSize: `${this.fontSize}px`, |
| 864 | lineHeight: `${lineHeight}` |
| 865 | }, |
| 866 | ".cm-gutters": { |
| 867 | fontSize: `${this.fontSize}px` |
| 868 | }, |
| 869 | ".cm-line": { |
| 870 | fontSize: `${this.fontSize}px`, |
| 871 | lineHeight: `${lineHeight}` |
| 872 | } |
| 873 | }); |
| 874 | } |
| 875 | |
| 876 | // 供外部调用的刷新方法 |
| 877 | refreshSettings() { |
no outgoing calls
no test coverage detected