File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/vs/editor/contrib/codeAction/browser Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,6 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
85
85
if ( this . state . type !== LightBulbState . Type . Showing ) {
86
86
return ;
87
87
}
88
- const focusEditor = ( ) => {
89
- this . _editor . focus ( ) ;
90
- e . preventDefault ( ) ;
91
- } ;
92
88
93
89
const option = this . _editor . getOption ( EditorOption . lightbulb ) . experimental . showAiIcon ;
94
90
if (
@@ -99,12 +95,14 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
99
95
const action = this . state . actions . validActions [ 0 ] . action ;
100
96
if ( action . command ?. id ) {
101
97
commandService . executeCommand ( action . command . id , ...( action . command . arguments || [ ] ) ) ;
98
+ e . preventDefault ( ) ;
99
+ return ;
102
100
}
103
- focusEditor ( ) ;
104
- return ;
105
101
}
106
102
// Make sure that focus / cursor location is not lost when clicking widget icon
107
- focusEditor ( ) ;
103
+ this . _editor . focus ( ) ;
104
+ e . preventDefault ( ) ;
105
+
108
106
// a bit of extra work to make sure the menu
109
107
// doesn't cover the line-text
110
108
const { top, height } = dom . getDomNodePagePosition ( this . _domNode ) ;
You can’t perform that action at this time.
0 commit comments