Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/dist/terminal-buffer.js b/dist/terminal-buffer.js
index 197ecab7df10ed4b19473af370bb551635ddbe6e..26cea6765fb25dbf0af364c30e764c827f2c8fe9 100644
index 197ecab7df10ed4b19473af370bb551635ddbe6e..a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0 100644
--- a/dist/terminal-buffer.js
+++ b/dist/terminal-buffer.js
@@ -442,7 +442,9 @@ export class GhosttyTerminalRenderable extends TextBufferRenderable {
Expand All @@ -8,7 +8,7 @@ index 197ecab7df10ed4b19473af370bb551635ddbe6e..26cea6765fb25dbf0af364c30e764c82
const lineInfo = this.textBufferView.logicalLineInfo;
- this._lineCount = lineInfo.lineStarts.length;
+ if (lineInfo) {
+ this._lineCount = lineInfo.lineStarts.length;
+ this._lineCount = lineInfo.lineStartCols?.length ?? lineInfo.lineStarts?.length ?? this._lineCount;
+ }
this._ansiDirty = false;
}
Expand All @@ -18,7 +18,7 @@ index 197ecab7df10ed4b19473af370bb551635ddbe6e..26cea6765fb25dbf0af364c30e764c82
// This accounts for wrapping and actual text layout
const lineInfo = this.textBufferView.logicalLineInfo;
- const lineStarts = lineInfo.lineStarts;
+ const lineStarts = lineInfo?.lineStarts;
+ const lineStarts = lineInfo?.lineStartCols ?? lineInfo?.lineStarts;
// If we have line start info, use it; otherwise fall back to simple calculation
let lineYOffset = clampedLine;
if (lineStarts && lineStarts.length > clampedLine) {
Expand All @@ -29,46 +29,46 @@ index 197ecab7df10ed4b19473af370bb551635ddbe6e..26cea6765fb25dbf0af364c30e764c82
+const EMPTY_LINE_INFO = { lineStarts: [], lineStartCols: [], lineWidthColsMax: 0, lineSources: [] };
+Object.defineProperty(GhosttyTerminalRenderable.prototype, 'lineInfo', {
+ get() {
+ return this.textBufferView.logicalLineInfo ?? EMPTY_LINE_INFO;
+ return this.textBufferView?.logicalLineInfo ?? EMPTY_LINE_INFO;
+ },
+ configurable: true,
+});
/** @deprecated Use GhosttyTerminalRenderable instead */
export const TerminalBufferRenderable = GhosttyTerminalRenderable;
diff --git a/src/terminal-buffer.ts b/src/terminal-buffer.ts
index 818145199154a290083de72f87a69ecbc2acd167..74d376238fb1c2702e6b070b20cdbb6cc26bb67f 100644
index 818145199154a290083de72f87a69ecbc2acd167..b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0 100644
--- a/src/terminal-buffer.ts
+++ b/src/terminal-buffer.ts
@@ -585,7 +585,9 @@ export class GhosttyTerminalRenderable extends TextBufferRenderable {

// Update line count based on actual rendered lines
const lineInfo = this.textBufferView.logicalLineInfo
- this._lineCount = lineInfo.lineStarts.length
+ if (lineInfo) {
+ this._lineCount = lineInfo.lineStarts.length
+ this._lineCount = lineInfo.lineStartCols?.length ?? lineInfo.lineStarts?.length ?? this._lineCount
+ }

this._ansiDirty = false
}
@@ -613,8 +615,8 @@ export class GhosttyTerminalRenderable extends TextBufferRenderable {
// Get the line info which contains actual Y offsets for each line
// This accounts for wrapping and actual text layout
const lineInfo = this.textBufferView.logicalLineInfo
- const lineStarts = lineInfo.lineStarts
-
+ const lineStarts = lineInfo?.lineStarts
-
+ const lineStarts = lineInfo?.lineStartCols ?? lineInfo?.lineStarts
+
// If we have line start info, use it; otherwise fall back to simple calculation
let lineYOffset = clampedLine
if (lineStarts && lineStarts.length > clampedLine) {
@@ -626,5 +628,13 @@ export class GhosttyTerminalRenderable extends TextBufferRenderable {
}
}

+const EMPTY_LINE_INFO = { lineStarts: [], lineStartCols: [], lineWidthColsMax: 0, lineSources: [] }
+Object.defineProperty(GhosttyTerminalRenderable.prototype, 'lineInfo', {
+ get() {
+ return this.textBufferView.logicalLineInfo ?? EMPTY_LINE_INFO
+ return this.textBufferView?.logicalLineInfo ?? EMPTY_LINE_INFO
+ },
+ configurable: true,
+})
Expand Down
Loading