@@ -25,8 +25,7 @@ export class SettingsEditor {
25
25
await this . openUserSettingsFile ( ) ;
26
26
27
27
await this . code . dispatchKeybinding ( 'right' ) ;
28
- const selectionOffset = this . _editContextSelectionOffset ( ) ;
29
- await this . editor . waitForEditorSelection ( 'settings.json' , s => s . selectionStart === selectionOffset && s . selectionEnd === selectionOffset ) ;
28
+ await this . editor . waitForEditorSelection ( 'settings.json' , ( s ) => this . _acceptEditorSelection ( this . code . quality , s ) ) ;
30
29
await this . editor . waitForTypeInEditor ( 'settings.json' , `"${ setting } ": ${ value } ,` ) ;
31
30
await this . editors . saveOpenedFile ( ) ;
32
31
}
@@ -41,8 +40,7 @@ export class SettingsEditor {
41
40
await this . openUserSettingsFile ( ) ;
42
41
43
42
await this . code . dispatchKeybinding ( 'right' ) ;
44
- const selectionOffset = this . _editContextSelectionOffset ( ) ;
45
- await this . editor . waitForEditorSelection ( 'settings.json' , ( s ) => s . selectionStart === selectionOffset && s . selectionEnd === selectionOffset ) ;
43
+ await this . editor . waitForEditorSelection ( 'settings.json' , ( s ) => this . _acceptEditorSelection ( this . code . quality , s ) ) ;
46
44
await this . editor . waitForTypeInEditor ( 'settings.json' , settings . map ( v => `"${ v [ 0 ] } ": ${ v [ 1 ] } ,` ) . join ( '' ) ) ;
47
45
await this . editors . saveOpenedFile ( ) ;
48
46
}
@@ -86,7 +84,10 @@ export class SettingsEditor {
86
84
return this . code . quality === Quality . Stable ? SEARCH_BOX_TEXTAREA : SEARCH_BOX_NATIVE_EDIT_CONTEXT ;
87
85
}
88
86
89
- private _editContextSelectionOffset ( ) : number {
90
- return this . code . quality === Quality . Stable ? 0 : 1 ;
87
+ private _acceptEditorSelection ( quality : Quality , s : { selectionStart : number ; selectionEnd : number } ) : boolean {
88
+ if ( quality === Quality . Stable ) {
89
+ return true ;
90
+ }
91
+ return s . selectionStart === 1 && s . selectionEnd === 1 ;
91
92
}
92
93
}
0 commit comments