Add insertTextAtCursorInternal() to properly handle newlines by splitting lines at the cursor position. - Normalize line endings (CRLF/CR to LF) - Handle single-line and multi-line insertion - Position cursor at end of inserted text - Call onChange only once at the end Refactor handlePaste() to use insertTextAtCursorInternal() for multi-line pastes, while retaining character-by-character insertion for single-line pastes to preserve autocomplete triggering.
59 KiB
59 KiB