File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/vs/workbench/browser/actions Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -586,9 +586,23 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
586586 return ;
587587 }
588588
589+ const selection = widget . getSelection ( ) ;
590+ const focus = widget . getFocus ( ) [ 0 ] ;
589591 const fakeKeyboardEvent = new KeyboardEvent ( 'keydown' ) ;
590- widget . setSelection ( [ ] , fakeKeyboardEvent ) ;
591- widget . setFocus ( [ ] , fakeKeyboardEvent ) ;
592+
593+ if ( selection . length > 1 ) {
594+ if ( focus ) {
595+ widget . setSelection ( [ focus ] , fakeKeyboardEvent ) ;
596+ } else {
597+ widget . setSelection ( selection [ 0 ] , fakeKeyboardEvent ) ;
598+ }
599+ } else if ( selection . length === 1 && selection [ 0 ] !== focus ) {
600+ widget . setSelection ( [ focus ] , fakeKeyboardEvent ) ;
601+ } else {
602+ widget . setSelection ( [ ] , fakeKeyboardEvent ) ;
603+ widget . setFocus ( [ ] , fakeKeyboardEvent ) ;
604+ }
605+
592606 widget . setAnchor ( undefined ) ;
593607 }
594608} ) ;
You can’t perform that action at this time.
0 commit comments