Skip to content

Commit de74700

Browse files
committed
Prevent symbol removal when pasting multiline text into the prompt input
- when pasting multi-line text that contains symbols, don't paste as long text
1 parent 28271ed commit de74700

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

apps/editor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
44
"description": "Fast and safe way to code with AI (CWC)",
5-
"version": "1.870.0",
5+
"version": "1.871.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

packages/ui/src/components/editor/panel/PromptField/hooks/use-handlers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,17 @@ export const use_handlers = (
520520
text == props.current_selection.text &&
521521
props.currently_open_file_path
522522

523+
const has_symbols =
524+
get_symbol_ranges({
525+
text,
526+
context_file_paths: props.context_file_paths ?? []
527+
}).length > 0
528+
523529
if (
524530
!is_shift_pressed_ref.current &&
525531
text.includes('\n') &&
526-
!is_fragment_paste
532+
!is_fragment_paste &&
533+
!has_symbols
527534
) {
528535
const selection = window.getSelection()
529536
if (

0 commit comments

Comments
 (0)