Skip to content

Commit

Permalink
placing the check effective column number into the if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
aiday-mar committed Dec 8, 2023
1 parent bc286f4 commit 7c7c185
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
};

let effectiveLineNumber = lineNumber;
let effectiveColumnNumber = 1;
if (!lineHasSpace) {
if (lineNumber > 1 && !isFolded(lineNumber - 1)) {
effectiveLineNumber -= 1;
Expand All @@ -208,10 +209,11 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
// it inline would overlay the cursor...
return this.hide();
}
effectiveColumnNumber = !!model.getLineContent(effectiveLineNumber).match(/^\S\s*$/) ? 2 : 1;
}

this.state = new LightBulbState.Showing(actions, trigger, atPosition, {
position: { lineNumber: effectiveLineNumber, column: !!model.getLineContent(effectiveLineNumber).match(/^\S\s*$/) ? 2 : 1 },
position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber },
preference: LightBulbWidget._posPref
});
this._editor.layoutContentWidget(this);
Expand Down

0 comments on commit 7c7c185

Please sign in to comment.