File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -426,8 +426,9 @@ export function WorkflowSearchReplace() {
426426 handleSelectMatch ( hydratedMatches [ nextIndex ] . id )
427427 }
428428
429- const handleApply = ( matchIds : string [ ] ) => {
429+ const handleApply = ( matchIds : string [ ] , replaceActiveIndex ?: number ) => {
430430 if ( ! workflowId || isApplying || searchReadOnly ) return
431+ if ( replaceActiveIndex !== undefined ) afterReplaceIndexRef . current = replaceActiveIndex
431432 setIsApplying ( true )
432433 let committed = false
433434
@@ -535,8 +536,7 @@ export function WorkflowSearchReplace() {
535536
536537 const handleReplaceActive = ( ) => {
537538 if ( ! activeMatch ) return
538- afterReplaceIndexRef . current = activeMatchIndex
539- handleApply ( [ activeMatch . id ] )
539+ handleApply ( [ activeMatch . id ] , activeMatchIndex )
540540 }
541541
542542 const handleReplaceAll = ( ) => {
You can’t perform that action at this time.
0 commit comments