Change AltClickHandler to be functional

This commit is contained in:
Daniel Imms
2019-06-22 17:55:59 -07:00
parent 7454701c0b
commit 13a63efdab
2 changed files with 129 additions and 144 deletions
+3 -4
View File
@@ -8,13 +8,13 @@ import { IBuffer } from 'common/buffer/Types';
import { IBufferLine } from 'common/Types';
import * as Browser from 'common/Platform';
import { SelectionModel } from 'browser/selection/SelectionModel';
import { AltClickHandler } from './handlers/AltClickHandler';
import { CellData } from 'common/buffer/CellData';
import { IDisposable } from 'xterm';
import { EventEmitter, IEvent } from 'common/EventEmitter';
import { ICharSizeService, IMouseService } from 'browser/services/Services';
import { IBufferService, IOptionsService } from 'common/services/Services';
import { getCoordsRelativeToElement } from 'browser/input/Mouse';
import { moveToCellSequence } from 'handlers/AltClickHandler';
/**
* The number of pixels the mouse needs to be above or below the viewport in
@@ -659,9 +659,8 @@ export class SelectionManager implements ISelectionManager {
false
);
if (coordinates && coordinates[0] !== undefined && coordinates[1] !== undefined) {
this._terminal.handler(
(new AltClickHandler()).move(coordinates[0] - 1, coordinates[1] - 1, this._bufferService, this._terminal.applicationCursor)
);
const sequence = moveToCellSequence(coordinates[0] - 1, coordinates[1] - 1, this._bufferService, this._terminal.applicationCursor);
this._terminal.handler(sequence);
}
}
} else if (this.hasSelection) {