File tree 1 file changed +15
-0
lines changed
src/vs/workbench/browser/parts/titlebar
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,21 @@ export class CommandCenterControl {
147
147
} ;
148
148
menuUpdater ( ) ;
149
149
this . _disposables . add ( menu . onDidChange ( menuUpdater ) ) ;
150
+ this . _disposables . add ( keybindingService . onDidUpdateKeybindings ( e => {
151
+ if ( ! e . keybindings ?. length ) {
152
+ // when resetting a keybinding it isn't properly reported and we are better safe
153
+ // than sorry. See https://github.com/microsoft/vscode/issues/151712
154
+ menuUpdater ( ) ;
155
+ return ;
156
+ }
157
+ const commands = new Set ( e . keybindings . map ( kb => kb . command ) ) ;
158
+ for ( let i = 0 , len = titleToolbar . getItemsLength ( ) ; i < len ; i ++ ) {
159
+ if ( commands . has ( titleToolbar . getItemAction ( i ) . id ) ) {
160
+ menuUpdater ( ) ;
161
+ break ;
162
+ }
163
+ }
164
+ } ) ) ;
150
165
this . _disposables . add ( quickInputService . onShow ( this . _setVisibility . bind ( this , false ) ) ) ;
151
166
this . _disposables . add ( quickInputService . onHide ( this . _setVisibility . bind ( this , true ) ) ) ;
152
167
}
You can’t perform that action at this time.
0 commit comments