Use buffer y for relative cursor pos

This commit is contained in:
Daniel Imms
2021-04-01 12:05:17 -07:00
parent 085a2b545f
commit 3ae61fc1dd
+1 -3
View File
@@ -207,12 +207,10 @@ export class CompositionHelper {
}
if (this._bufferService.buffer.isCursorInViewport) {
const cursorY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;
const viewportRelativeCursorY = cursorY - this._bufferService.buffer.ydisp;
const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);
const cellHeight = this._renderService.dimensions.actualCellHeight;
const cursorTop = viewportRelativeCursorY * this._renderService.dimensions.actualCellHeight;
const cursorTop = this._bufferService.buffer.y * this._renderService.dimensions.actualCellHeight;
const cursorLeft = cursorX * this._renderService.dimensions.actualCellWidth;
this._compositionView.style.left = cursorLeft + 'px';