This commit is contained in:
Daniel Imms
2018-06-30 10:11:48 -07:00
parent 3a4ad37177
commit 117c79e4e7
2 changed files with 3 additions and 18 deletions
+2 -16
View File
@@ -186,7 +186,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
const result: string[] = []; const result: string[] = [];
if (this._activeSelectionMode === SelectionMode.COLUMN) { if (this._activeSelectionMode === SelectionMode.COLUMN) {
// Ignore zero width selections // Ignore zero width selections
if (start[0] === end[0]) { if (start[0] === end[0]) {
return ''; return '';
@@ -196,7 +195,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
const lineText = this._buffer.translateBufferLineToString(i, true, start[0], end[0]); const lineText = this._buffer.translateBufferLineToString(i, true, start[0], end[0]);
result.push(lineText); result.push(lineText);
} }
} else { } else {
// Get first row // Get first row
const startRowEndCol = start[1] === end[1] ? end[0] : null; const startRowEndCol = start[1] === end[1] ? end[0] : null;
@@ -427,11 +425,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
this._onIncrementalClick(event); this._onIncrementalClick(event);
} else { } else {
if (event.detail === 1) { if (event.detail === 1) {
if (this.shouldColumnSelect(event)) { this._onSingleClick(event);
this._onColumnSelectSingleClick(event);
} else {
this._onSingleClick(event);
}
} else if (event.detail === 2) { } else if (event.detail === 2) {
this._onDoubleClick(event); this._onDoubleClick(event);
} else if (event.detail === 3) { } else if (event.detail === 3) {
@@ -482,7 +476,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
private _onSingleClick(event: MouseEvent): void { private _onSingleClick(event: MouseEvent): void {
this._model.selectionStartLength = 0; this._model.selectionStartLength = 0;
this._model.isSelectAllActive = false; this._model.isSelectAllActive = false;
this._activeSelectionMode = SelectionMode.NORMAL; this._activeSelectionMode = this.shouldColumnSelect(event) ? SelectionMode.COLUMN : SelectionMode.NORMAL;
// Initialize the new selection // Initialize the new selection
this._model.selectionStart = this._getMouseBufferCoords(event); this._model.selectionStart = this._getMouseBufferCoords(event);
@@ -535,14 +529,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
} }
} }
/**
* Begin a column selection
*/
private _onColumnSelectSingleClick(event: MouseEvent): void {
this._onSingleClick(event); // Perform all the normal setup actions
this._activeSelectionMode = SelectionMode.COLUMN;
}
/** /**
* Returns whether the selection manager should operate in column select mode * Returns whether the selection manager should operate in column select mode
* @param event the mouse or keyboard event * @param event the mouse or keyboard event
+1 -2
View File
@@ -1509,9 +1509,8 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
} }
} }
protected _keyUp(ev: KeyboardEvent): boolean { protected _keyUp(ev: KeyboardEvent): void {
this.updateCursorStyle(ev); this.updateCursorStyle(ev);
return true;
} }
/** /**