提交 6a6d2ed2 编写于 作者: A Alexandru Dima

Merge pull request #124 from Microsoft/weinand-patch-1

fix for #39
......@@ -516,19 +516,12 @@ class WebKitViewLine extends ViewLine {
if (beforeEndVisibleRanges && beforeEndVisibleRanges.length > 0 && endVisibleRanges && endVisibleRanges.length > 0) {
var beforeEndVisibleRange = beforeEndVisibleRanges[0];
var endVisibleRange = endVisibleRanges[0];
var isLTR = true;
if (beforeEndVisibleRange.top === endVisibleRange.top) {
isLTR = (beforeEndVisibleRange.left <= endVisibleRange.left);
}
var isLTR = (beforeEndVisibleRange.left <= endVisibleRange.left);
var lastRange = output[output.length - 1];
if (isLTR && lastRange.top === endVisibleRange.top && lastRange.left < endVisibleRange.left) {
if (isLTR && lastRange.left < endVisibleRange.left) {
// Trim down the width of the last visible range to not go after the last column's position
lastRange.width = endVisibleRange.left - lastRange.left;
} else if (lastRange.top > endVisibleRange.top) {
// WebKit went over to next line with its expanded range
output.splice(output.length - 1, 1);
}
}
......@@ -560,10 +553,7 @@ class RangeUtil {
}
function compareVisibleRanges(a: EditorBrowser.IVisibleRange, b: EditorBrowser.IVisibleRange): number {
if (a.top === b.top) {
return a.left - b.left;
}
return a.top - b.top;
return a.left - b.left;
}
function findIndexInArrayWithMax(lineParts:ILineParts, desiredIndex: number, maxResult:number): number {
......@@ -759,4 +749,4 @@ export function renderLine(input:IRenderLineInput): IRenderLineOutput {
result.partsCount = partsCount;
return result;
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册