1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/editor/CodeMirror/utils/isCursorAtBeginning.ts

9 lines
274 B
TypeScript

import { EditorState } from '@codemirror/state';
const isCursorAtBeginning = (state: EditorState) => {
const selection = state.selection;
return selection.ranges.length === 1 && selection.main.empty && selection.main.anchor === 0;
};
export default isCursorAtBeginning;