@@ -33,16 +33,17 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
3333 setSoundVolume,
3434 diffEnabled,
3535 setDiffEnabled,
36- browserLargeViewport = false ,
36+ browserLargeViewport,
3737 setBrowserLargeViewport,
3838 openRouterModels,
3939 setAllowedCommands,
4040 allowedCommands,
41+ fuzzyMatchThreshold,
42+ setFuzzyMatchThreshold,
4143 } = useExtensionState ( )
4244 const [ apiErrorMessage , setApiErrorMessage ] = useState < string | undefined > ( undefined )
4345 const [ modelIdErrorMessage , setModelIdErrorMessage ] = useState < string | undefined > ( undefined )
4446 const [ commandInput , setCommandInput ] = useState ( "" )
45-
4647 const handleSubmit = ( ) => {
4748 const apiValidationResult = validateApiConfiguration ( apiConfiguration )
4849 const modelIdValidationResult = validateModelId ( apiConfiguration , openRouterModels )
@@ -65,6 +66,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
6566 vscode . postMessage ( { type : "soundVolume" , value : soundVolume } )
6667 vscode . postMessage ( { type : "diffEnabled" , bool : diffEnabled } )
6768 vscode . postMessage ( { type : "browserLargeViewport" , bool : browserLargeViewport } )
69+ vscode . postMessage ( { type : "fuzzyMatchThreshold" , value : fuzzyMatchThreshold ?? 1.0 } )
6870 onDone ( )
6971 }
7072 }
@@ -166,6 +168,35 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
166168 } } >
167169 When enabled, Cline will be able to edit files more quickly and will automatically reject truncated full-file writes. Works best with the latest Claude 3.5 Sonnet model.
168170 </ p >
171+
172+ { diffEnabled && (
173+ < div style = { { marginTop : 10 } } >
174+ < div style = { { display : 'flex' , alignItems : 'center' , gap : '5px' } } >
175+ < span style = { { fontWeight : "500" , minWidth : '100px' } } > Match precision</ span >
176+ < input
177+ type = "range"
178+ min = "0.9"
179+ max = "1"
180+ step = "0.005"
181+ value = { fuzzyMatchThreshold ?? 1.0 }
182+ onChange = { ( e ) => {
183+ setFuzzyMatchThreshold ( parseFloat ( e . target . value ) ) ;
184+ } }
185+ style = { {
186+ flexGrow : 1 ,
187+ accentColor : 'var(--vscode-button-background)' ,
188+ height : '2px'
189+ } }
190+ />
191+ < span style = { { minWidth : '35px' , textAlign : 'left' } } >
192+ { Math . round ( ( fuzzyMatchThreshold || 1 ) * 100 ) } %
193+ </ span >
194+ </ div >
195+ < p style = { { fontSize : "12px" , marginBottom : 10 , color : "var(--vscode-descriptionForeground)" } } >
196+ This slider controls how precisely code sections must match when applying diffs. Lower values allow more flexible matching but increase the risk of incorrect replacements. Use values below 100% with extreme caution.
197+ </ p >
198+ </ div >
199+ ) }
169200 </ div >
170201
171202 < div style = { { marginBottom : 5 } } >
@@ -351,7 +382,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
351382 { soundEnabled && (
352383 < div style = { { marginLeft : 0 } } >
353384 < div style = { { display : 'flex' , alignItems : 'center' , gap : '5px' } } >
354- < span style = { { fontWeight : "500" , minWidth : '50px ' } } > Volume</ span >
385+ < span style = { { fontWeight : "500" , minWidth : '100px ' } } > Volume</ span >
355386 < input
356387 type = "range"
357388 min = "0"
0 commit comments