File tree Expand file tree Collapse file tree
packages/opencode/src/cli/cmd/tui/component/prompt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,6 +159,28 @@ export function Autocomplete(props: {
159159 } )
160160
161161 props . setPrompt ( ( draft ) => {
162+ if ( part . type === "file" ) {
163+ const existingIndex = draft . parts . findIndex (
164+ ( p ) => p . type === "file" && "url" in p && p . url === part . url ,
165+ )
166+ if ( existingIndex !== - 1 ) {
167+ const existing = draft . parts [ existingIndex ]
168+ if (
169+ part . source ?. text &&
170+ existing &&
171+ "source" in existing &&
172+ existing . source &&
173+ "text" in existing . source &&
174+ existing . source . text
175+ ) {
176+ existing . source . text . start = extmarkStart
177+ existing . source . text . end = extmarkEnd
178+ existing . source . text . value = virtualText
179+ }
180+ return
181+ }
182+ }
183+
162184 if ( part . type === "file" && part . source ?. text ) {
163185 part . source . text . start = extmarkStart
164186 part . source . text . end = extmarkEnd
You can’t perform that action at this time.
0 commit comments