@@ -59,7 +59,6 @@ import { ensureNoteEditorVimNavigation } from "@/features/editor/lib/note-editor
5959import { EditorToolbar } from "@/features/editor/ui/editor-toolbar" ;
6060import { HighlightSyntax } from "@/features/editor/extensions/markdown-decorations" ;
6161import { getInlineSyntaxRightBoundaryAtCursor } from "@/features/editor/extensions/markdown-decorations/builders/inline-boundaries" ;
62- import { getSnappedCursorPosition } from "@/features/editor/extensions/markdown-decorations/snap-cursor" ;
6362import {
6463 TagGrammar ,
6564 tagHighlightStyle ,
@@ -254,11 +253,7 @@ function dispatchPointerCursorSelection(view: EditorView, pos: number) {
254253 } ) ;
255254}
256255
257- function handleSpecialMouseDownSelection (
258- view : EditorView ,
259- event : MouseEvent ,
260- leadingPaddingLineStart : number | null ,
261- ) {
256+ function handleSpecialMouseDownSelection ( view : EditorView , event : MouseEvent ) {
262257 if ( trySnapInlineSyntaxRightBoundaryClick ( view , event ) ) {
263258 return true ;
264259 }
@@ -296,17 +291,6 @@ function handleSpecialMouseDownSelection(
296291 return true ;
297292 }
298293
299- if ( leadingPaddingLineStart != null ) {
300- event . preventDefault ( ) ;
301- event . stopPropagation ( ) ;
302-
303- if ( ! view . hasFocus ) {
304- focusEditorPreservingScroll ( view ) ;
305- }
306-
307- return true ;
308- }
309-
310294 return false ;
311295}
312296
@@ -445,52 +429,14 @@ export const NoteEditor = forwardRef<NoteEditorHandle, NoteEditorProps>(
445429 search ( ) ,
446430 EditorView . domEventHandlers ( {
447431 mousedown ( event , view ) {
448- const leadingPaddingLineStart = getLeadingPaddingClickLineStart (
449- view ,
450- event ,
451- ) ;
452-
453- if (
454- handleSpecialMouseDownSelection (
455- view ,
456- event ,
457- leadingPaddingLineStart ,
458- )
459- ) {
432+ if ( handleSpecialMouseDownSelection ( view , event ) ) {
460433 return true ;
461434 }
462435
463436 event . stopPropagation ( ) ;
464- const directPos = view . posAtCoords (
465- {
466- x : event . clientX ,
467- y : event . clientY ,
468- } ,
469- false ,
470- ) ;
471437
472438 if ( ! view . hasFocus ) {
473- event . preventDefault ( ) ;
474-
475- const clickedInsideTable =
476- event . target instanceof HTMLElement &&
477- event . target . closest ( ".cm-md-table-wrapper" ) ;
478-
479439 focusEditorPreservingScroll ( view ) ;
480-
481- if ( clickedInsideTable ) {
482- return false ;
483- }
484-
485- if ( directPos != null ) {
486- const snappedPos =
487- getSnappedCursorPosition ( view . state , directPos ) ??
488- directPos ;
489-
490- dispatchPointerCursorSelection ( view , snappedPos ) ;
491- }
492-
493- return true ;
494440 }
495441
496442 return false ;
0 commit comments