Merge pull request #1309 from Tyriar/1305_alt_horizontal_only
Only move horizontally on alt click in normal buffer
This commit is contained in:
@@ -252,6 +252,7 @@ export interface IBuffer {
|
|||||||
tabs: any;
|
tabs: any;
|
||||||
scrollBottom: number;
|
scrollBottom: number;
|
||||||
scrollTop: number;
|
scrollTop: number;
|
||||||
|
hasScrollback: boolean;
|
||||||
savedY: number;
|
savedY: number;
|
||||||
savedX: number;
|
savedX: number;
|
||||||
isCursorInViewport: boolean;
|
isCursorInViewport: boolean;
|
||||||
|
|||||||
@@ -56,9 +56,13 @@ export class AltClickHandler {
|
|||||||
* then moves to requested col.
|
* then moves to requested col.
|
||||||
*/
|
*/
|
||||||
private _arrowSequences(): string {
|
private _arrowSequences(): string {
|
||||||
return this._resetStartingRow() +
|
// The alt buffer should try to navigate between rows
|
||||||
this._moveToRequestedRow() +
|
if (!this._terminal.buffer.hasScrollback) {
|
||||||
this._moveToRequestedCol();
|
return this._resetStartingRow() + this._moveToRequestedRow() + this._moveToRequestedCol();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only move horizontally for the normal buffer
|
||||||
|
return this._moveHorizontallyOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +117,11 @@ export class AltClickHandler {
|
|||||||
).length, this._sequence(direction));
|
).length, this._sequence(direction));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _moveHorizontallyOnly(): string {
|
||||||
|
let direction = this._horizontalDirection();
|
||||||
|
return repeat(Math.abs(this._startCol - this._endCol), this._sequence(direction));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility functions
|
* Utility functions
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ export class MockBuffer implements IBuffer {
|
|||||||
lines: ICircularList<[number, string, number, number][]>;
|
lines: ICircularList<[number, string, number, number][]>;
|
||||||
ydisp: number;
|
ydisp: number;
|
||||||
ybase: number;
|
ybase: number;
|
||||||
|
hasScrollback: boolean;
|
||||||
y: number;
|
y: number;
|
||||||
x: number;
|
x: number;
|
||||||
tabs: any;
|
tabs: any;
|
||||||
|
|||||||
Reference in New Issue
Block a user