Skip to content

Commit

Permalink
Fixes microsoft/monaco-editor#137: Add fallback case when hit testing…
Browse files Browse the repository at this point in the history
… completely fails
  • Loading branch information
alexdima committed Aug 31, 2016
1 parent 5aee842 commit c3718ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vs/editor/browser/controller/mouseTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ export class MouseTargetFactory {
if (lineNumberAttribute && columnAttribute) {
return this.createMouseTargetFromViewCursor(t, parseInt(lineNumberAttribute, 10), parseInt(columnAttribute, 10), mouseColumn);
}
} else {
// Hit testing completely failed...
let possibleLineNumber = this._viewHelper.getLineNumberAtVerticalOffset(mouseVerticalOffset);
let maxColumn = this._context.model.getLineMaxColumn(possibleLineNumber);
return new MouseTarget(t, MouseTargetType.CONTENT_EMPTY, mouseColumn, new Position(possibleLineNumber, maxColumn));
}
}

Expand Down

0 comments on commit c3718ce

Please sign in to comment.