Skip to content

Commit 53c1522

Browse files
Tidy
1 parent c69e651 commit 53c1522

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/editor/codemirror/dnd.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,8 @@ const findLogicalPosition = (
218218
view: EditorView,
219219
event: DragEvent
220220
): { line: number; indent: number | undefined } => {
221-
const visualLine = view.lineBlockAtHeight(
222-
event.y - view.documentTop || event.clientY - view.documentTop
223-
);
221+
const height = (event.y || event.clientY) - view.documentTop;
222+
const visualLine = view.lineBlockAtHeight(height);
224223
const line = view.state.doc.lineAt(visualLine.from);
225224
const pos = view.posAtCoords({
226225
x: event.x || event.clientX,

0 commit comments

Comments
 (0)