Fix the composition element's position

This commit is contained in:
Daniel Imms
2017-09-02 18:41:53 -07:00
parent c5a6d96a62
commit 7ccac09b6b
4 changed files with 23 additions and 10 deletions
+6
View File
@@ -52,6 +52,12 @@ export class Buffer implements IBuffer {
return this._hasScrollback && this.lines.maxLength > this._terminal.rows;
}
public get isCursorInViewport(): boolean {
const absoluteY = this.ybase + this.y;
const relativeY = absoluteY - this.ydisp;
return (relativeY >= 0 && relativeY < this._terminal.rows);
}
/**
* Gets the correct buffer length based on the rows provided, the terminal's
* scrollback and whether this buffer is flagged to have scrollback or not.