mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 01:25:38 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -25,6 +25,13 @@ export interface IViewZoneData {
|
||||
afterLineNumber: number;
|
||||
}
|
||||
|
||||
export interface IMarginData {
|
||||
isAfterLines: boolean;
|
||||
glyphMarginWidth: number;
|
||||
lineNumbersWidth: number;
|
||||
offsetX: number;
|
||||
}
|
||||
|
||||
interface IETextRange {
|
||||
boundingHeight: number;
|
||||
boundingLeft: number;
|
||||
@@ -565,22 +572,28 @@ export class MouseTargetFactory {
|
||||
if (request.isInMarginArea) {
|
||||
let res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset);
|
||||
let pos = res.range.getStartPosition();
|
||||
|
||||
let offset = Math.abs(request.pos.x - request.editorPos.x);
|
||||
const detail: IMarginData = {
|
||||
isAfterLines: res.isAfterLines,
|
||||
glyphMarginWidth: ctx.layoutInfo.glyphMarginWidth,
|
||||
lineNumbersWidth: ctx.layoutInfo.lineNumbersWidth,
|
||||
offsetX: offset
|
||||
};
|
||||
|
||||
if (offset <= ctx.layoutInfo.glyphMarginWidth) {
|
||||
// On the glyph margin
|
||||
return request.fulfill(MouseTargetType.GUTTER_GLYPH_MARGIN, pos, res.range, res.isAfterLines);
|
||||
return request.fulfill(MouseTargetType.GUTTER_GLYPH_MARGIN, pos, res.range, detail);
|
||||
}
|
||||
offset -= ctx.layoutInfo.glyphMarginWidth;
|
||||
|
||||
if (offset <= ctx.layoutInfo.lineNumbersWidth) {
|
||||
// On the line numbers
|
||||
return request.fulfill(MouseTargetType.GUTTER_LINE_NUMBERS, pos, res.range, res.isAfterLines);
|
||||
return request.fulfill(MouseTargetType.GUTTER_LINE_NUMBERS, pos, res.range, detail);
|
||||
}
|
||||
offset -= ctx.layoutInfo.lineNumbersWidth;
|
||||
|
||||
// On the line decorations
|
||||
return request.fulfill(MouseTargetType.GUTTER_LINE_DECORATIONS, pos, res.range, res.isAfterLines);
|
||||
return request.fulfill(MouseTargetType.GUTTER_LINE_DECORATIONS, pos, res.range, detail);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user