mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
threshold for collapsing pasted text
This commit is contained in:
parent
1d48f763c2
commit
dd6648bc49
1 changed files with 7 additions and 3 deletions
|
|
@ -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 + " "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue