1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Add new beta Markdown editor based on CodeMirror 6 (#8793)

This commit is contained in:
Henry Heino
2023-09-21 01:12:40 -07:00
committed by GitHub
parent c3971ff226
commit 84c6de9b56
70 changed files with 4201 additions and 1306 deletions

View File

@@ -0,0 +1,11 @@
import { EditorView } from '@codemirror/view';
const getScrollFraction = (view: EditorView) => {
const maxScroll = view.scrollDOM.scrollHeight - view.scrollDOM.clientHeight;
// Prevent division by zero
return maxScroll > 0 ? view.scrollDOM.scrollTop / maxScroll : 0;
};
export default getScrollFraction;