Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Jan 28, 2018
1 parent 5506af5 commit 0bdf1e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
22 changes: 0 additions & 22 deletions src/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,28 +1187,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.refresh(0, this.rows - 1);
}

/**
* Scroll the viewport to an absolute row in the buffer.
* @param absoluteRow The absolute row in the buffer to scroll to.
* @returns The actual absolute row that was scrolled to (including boundary checked).
*/
public scrollToRow(absoluteRow: number): number {
// Ensure value is valid
absoluteRow = Math.max(Math.min(absoluteRow, this.buffer.lines.length - 1), 0);

// Move viewport as necessary
const relativeRow = absoluteRow - this.buffer.ydisp;
let scrollAmount = 0;
if (relativeRow < 0) {
scrollAmount = relativeRow;
} else if (relativeRow >= this.rows) {
scrollAmount = relativeRow - this.rows + 1;
}
this.scrollLines(scrollAmount);

return absoluteRow;
}

/**
* Scroll the display of the terminal by a number of pages.
* @param {number} pageCount The number of pages to scroll (negative scrolls up).
Expand Down
1 change: 0 additions & 1 deletion src/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export interface ITerminal extends PublicTerminal, IElementAccessor, IBufferAcce
*/
handler(data: string): void;
scrollLines(disp: number, suppressScrollEvent?: boolean): void;
scrollToRow(row: number): number;
cancel(ev: Event, force?: boolean): boolean | void;
log(text: string): void;
showCursor(): void;
Expand Down

0 comments on commit 0bdf1e8

Please sign in to comment.