Skip to content

Commit 7c7c185

Browse files
committed
placing the check effective column number into the if statement
1 parent bc286f4 commit 7c7c185

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
198198
};
199199

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

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

0 commit comments

Comments
 (0)