File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/vs/editor/contrib/rename/browser Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -298,9 +298,10 @@ export class RenameInputField implements IContentWidget {
298
298
assertType ( this . _input !== undefined ) ;
299
299
assertType ( this . _candidatesView !== undefined ) ;
300
300
301
- const candidateName = this . _candidatesView . focusedCandidate ;
302
- if ( ( candidateName === undefined && this . _input . value === value ) || this . _input . value . trim ( ) . length === 0 ) {
303
- this . cancelInput ( true , '_currentAcceptInput (because candidateName is undefined or input.value is empty)' ) ;
301
+ const newName = this . _candidatesView . focusedCandidate ?? this . _input . value ;
302
+
303
+ if ( newName === value || newName . trim ( ) . length === 0 /* is just whitespace */ ) {
304
+ this . cancelInput ( true , '_currentAcceptInput (because newName === value || newName.trim().length === 0)' ) ;
304
305
return ;
305
306
}
306
307
@@ -309,7 +310,7 @@ export class RenameInputField implements IContentWidget {
309
310
this . _candidatesView . clearCandidates ( ) ;
310
311
311
312
resolve ( {
312
- newName : candidateName ?? this . _input . value ,
313
+ newName,
313
314
wantsPreview : supportPreview && wantsPreview
314
315
} ) ;
315
316
} ;
You can’t perform that action at this time.
0 commit comments