fix lightbulb jumping in the gutter (but like not the trash) (#227022)
* fix for flickering lightbulb * second fix * remove console logpull/227027/head
parent
59b2709194
commit
c293d5af42
|
@ -180,6 +180,12 @@ export class CodeActionController extends Disposable implements IEditorContribut
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
const selection = this._editor.getSelection();
|
||||
if (selection?.startLineNumber !== newState.position.lineNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._lightBulbWidget.value?.update(actions, newState.trigger, newState.position);
|
||||
|
||||
if (newState.trigger.type === CodeActionTriggerType.Invoke) {
|
||||
|
|
|
@ -271,7 +271,6 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
|||
const currLineEmptyOrIndented = isLineEmptyOrIndented(lineNumber);
|
||||
const notEmpty = !nextLineEmptyOrIndented && !prevLineEmptyOrIndented;
|
||||
|
||||
|
||||
// check above and below. if both are blocked, display lightbulb in the gutter.
|
||||
if (!nextLineEmptyOrIndented && !prevLineEmptyOrIndented && !hasDecoration) {
|
||||
this.gutterState = new LightBulbState.Showing(actions, trigger, atPosition, {
|
||||
|
@ -280,7 +279,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
|||
});
|
||||
this.renderGutterLightbub();
|
||||
return this.hide();
|
||||
} else if (prevLineEmptyOrIndented || endLine || (notEmpty && !currLineEmptyOrIndented)) {
|
||||
} else if (prevLineEmptyOrIndented || endLine || (prevLineEmptyOrIndented && !currLineEmptyOrIndented)) {
|
||||
effectiveLineNumber -= 1;
|
||||
} else if (nextLineEmptyOrIndented || (notEmpty && currLineEmptyOrIndented)) {
|
||||
effectiveLineNumber += 1;
|
||||
|
|
Loading…
Reference in New Issue