threshold for collapsing pasted text

This commit is contained in:
Sebastian Herrlinger 2025-10-28 22:23:29 +01:00
parent 1d48f763c2
commit dd6648bc49

View file

@ -503,12 +503,16 @@ export function Prompt(props: PromptProps) {
event.preventDefault()
return
}
event.preventDefault()
const pastedContent = event.text.trim()
if (!pastedContent) return
const lineCount = (pastedContent.match(/\n/g)?.length ?? 0) + 1
if (lineCount <= 5) {
return
}
event.preventDefault()
const currentOffset = input.visualCursor.offset
const virtualText = `[Pasted ~${lineCount} lines]`
const textToInsert = virtualText + " "