mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Polish
This commit is contained in:
+2
-16
@@ -186,7 +186,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
||||
const result: string[] = [];
|
||||
|
||||
if (this._activeSelectionMode === SelectionMode.COLUMN) {
|
||||
|
||||
// Ignore zero width selections
|
||||
if (start[0] === end[0]) {
|
||||
return '';
|
||||
@@ -196,7 +195,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
||||
const lineText = this._buffer.translateBufferLineToString(i, true, start[0], end[0]);
|
||||
result.push(lineText);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Get first row
|
||||
const startRowEndCol = start[1] === end[1] ? end[0] : null;
|
||||
@@ -427,11 +425,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
||||
this._onIncrementalClick(event);
|
||||
} else {
|
||||
if (event.detail === 1) {
|
||||
if (this.shouldColumnSelect(event)) {
|
||||
this._onColumnSelectSingleClick(event);
|
||||
} else {
|
||||
this._onSingleClick(event);
|
||||
}
|
||||
this._onSingleClick(event);
|
||||
} else if (event.detail === 2) {
|
||||
this._onDoubleClick(event);
|
||||
} else if (event.detail === 3) {
|
||||
@@ -482,7 +476,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
||||
private _onSingleClick(event: MouseEvent): void {
|
||||
this._model.selectionStartLength = 0;
|
||||
this._model.isSelectAllActive = false;
|
||||
this._activeSelectionMode = SelectionMode.NORMAL;
|
||||
this._activeSelectionMode = this.shouldColumnSelect(event) ? SelectionMode.COLUMN : SelectionMode.NORMAL;
|
||||
|
||||
// Initialize the new selection
|
||||
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
|
||||
* @param event the mouse or keyboard event
|
||||
|
||||
+1
-2
@@ -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);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user