Move alt click into browser
This commit is contained in:
@@ -14,7 +14,7 @@ import { EventEmitter, IEvent } from 'common/EventEmitter';
|
|||||||
import { ICharSizeService, IMouseService } from 'browser/services/Services';
|
import { ICharSizeService, IMouseService } from 'browser/services/Services';
|
||||||
import { IBufferService, IOptionsService } from 'common/services/Services';
|
import { IBufferService, IOptionsService } from 'common/services/Services';
|
||||||
import { getCoordsRelativeToElement } from 'browser/input/Mouse';
|
import { getCoordsRelativeToElement } from 'browser/input/Mouse';
|
||||||
import { moveToCellSequence } from 'handlers/AltClickHandler';
|
import { moveToCellSequence } from 'browser/input/MoveToCell';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of pixels the mouse needs to be above or below the viewport in
|
* The number of pixels the mouse needs to be above or below the viewport in
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ function wrappedRowsCount(startY: number, targetY: number, bufferService: IBuffe
|
|||||||
|
|
||||||
for (let i = 0; i < Math.abs(startRow - endRow); i++) {
|
for (let i = 0; i < Math.abs(startRow - endRow); i++) {
|
||||||
const direction = verticalDirection(startY, targetY) === Direction.UP ? -1 : 1;
|
const direction = verticalDirection(startY, targetY) === Direction.UP ? -1 : 1;
|
||||||
|
const line = bufferService.buffer.lines.get(startRow + (direction * i));
|
||||||
if (bufferService.buffer.lines.get(startRow + (direction * i)).isWrapped) {
|
if (line && line.isWrapped) {
|
||||||
wrappedRows++;
|
wrappedRows++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,12 +116,13 @@ function wrappedRowsCount(startY: number, targetY: number, bufferService: IBuffe
|
|||||||
*/
|
*/
|
||||||
function wrappedRowsForRow(bufferService: IBufferService, currentRow: number): number {
|
function wrappedRowsForRow(bufferService: IBufferService, currentRow: number): number {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let lineWraps = bufferService.buffer.lines.get(currentRow).isWrapped;
|
let line = bufferService.buffer.lines.get(currentRow);
|
||||||
|
let lineWraps = line && line.isWrapped;
|
||||||
|
|
||||||
while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {
|
while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {
|
||||||
rowCount++;
|
rowCount++;
|
||||||
currentRow--;
|
line = bufferService.buffer.lines.get(--currentRow);
|
||||||
lineWraps = bufferService.buffer.lines.get(currentRow).isWrapped;
|
lineWraps = line && line.isWrapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rowCount;
|
return rowCount;
|
||||||
Reference in New Issue
Block a user