1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +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;