@opentui/core 0.1.57 → 0.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -4573,6 +4573,7 @@ class DiffRenderable extends Renderable {
4573
4573
  _view;
4574
4574
  _parsedDiff = null;
4575
4575
  _parseError = null;
4576
+ _fg;
4576
4577
  _filetype;
4577
4578
  _syntaxStyle;
4578
4579
  _wrapMode;
@@ -4610,6 +4611,7 @@ class DiffRenderable extends Renderable {
4610
4611
  });
4611
4612
  this._diff = options.diff ?? "";
4612
4613
  this._view = options.view ?? "unified";
4614
+ this._fg = options.fg ? parseColor(options.fg) : undefined;
4613
4615
  this._filetype = options.filetype;
4614
4616
  this._syntaxStyle = options.syntaxStyle;
4615
4617
  this._wrapMode = options.wrapMode;
@@ -4770,6 +4772,7 @@ class DiffRenderable extends Renderable {
4770
4772
  syntaxStyle: this._syntaxStyle ?? SyntaxStyle.create(),
4771
4773
  width: "100%",
4772
4774
  height: "100%",
4775
+ ...this._fg !== undefined && { fg: this._fg },
4773
4776
  ...drawUnstyledText !== undefined && { drawUnstyledText },
4774
4777
  ...this._selectionBg !== undefined && { selectionBg: this._selectionBg },
4775
4778
  ...this._selectionFg !== undefined && { selectionFg: this._selectionFg },
@@ -4801,6 +4804,9 @@ class DiffRenderable extends Renderable {
4801
4804
  if (this._selectionFg !== undefined) {
4802
4805
  existingRenderable.selectionFg = this._selectionFg;
4803
4806
  }
4807
+ if (this._fg !== undefined) {
4808
+ existingRenderable.fg = this._fg;
4809
+ }
4804
4810
  return existingRenderable;
4805
4811
  }
4806
4812
  }
@@ -5412,6 +5418,21 @@ class DiffRenderable extends Renderable {
5412
5418
  this.rebuildView();
5413
5419
  }
5414
5420
  }
5421
+ get fg() {
5422
+ return this._fg;
5423
+ }
5424
+ set fg(value) {
5425
+ const parsed = value ? parseColor(value) : undefined;
5426
+ if (this._fg !== parsed) {
5427
+ this._fg = parsed;
5428
+ if (this.leftCodeRenderable) {
5429
+ this.leftCodeRenderable.fg = parsed;
5430
+ }
5431
+ if (this.rightCodeRenderable) {
5432
+ this.rightCodeRenderable.fg = parsed;
5433
+ }
5434
+ }
5435
+ }
5415
5436
  }
5416
5437
  // src/lib/keymapping.ts
5417
5438
  var defaultKeyAliases = {
@@ -6391,7 +6412,7 @@ class ContentRenderable extends BoxRenderable {
6391
6412
  }
6392
6413
  _getVisibleChildren() {
6393
6414
  if (this._viewportCulling) {
6394
- return getObjectsInViewport(this.viewport, this.getChildrenSortedByPrimaryAxis(), this.primaryAxis).map((child) => child.num);
6415
+ return getObjectsInViewport(this.viewport, this.getChildrenSortedByPrimaryAxis(), this.primaryAxis, 0).map((child) => child.num);
6395
6416
  }
6396
6417
  return this.getChildrenSortedByPrimaryAxis().map((child) => child.num);
6397
6418
  }
@@ -8430,7 +8451,13 @@ class TextareaRenderable extends EditBufferRenderable {
8430
8451
  const select = options?.select ?? false;
8431
8452
  this.updateSelectionForMovement(select, true);
8432
8453
  const cursor = this.editorView.getCursor();
8433
- this.editBuffer.setCursor(cursor.row, 0);
8454
+ if (cursor.col === 0 && cursor.row > 0) {
8455
+ this.editBuffer.setCursor(cursor.row - 1, 0);
8456
+ const prevLineEol = this.editBuffer.getEOL();
8457
+ this.editBuffer.setCursor(prevLineEol.row, prevLineEol.col);
8458
+ } else {
8459
+ this.editBuffer.setCursor(cursor.row, 0);
8460
+ }
8434
8461
  this.updateSelectionForMovement(select, false);
8435
8462
  this.requestRender();
8436
8463
  return true;
@@ -8438,8 +8465,14 @@ class TextareaRenderable extends EditBufferRenderable {
8438
8465
  gotoLineEnd(options) {
8439
8466
  const select = options?.select ?? false;
8440
8467
  this.updateSelectionForMovement(select, true);
8468
+ const cursor = this.editorView.getCursor();
8441
8469
  const eol = this.editBuffer.getEOL();
8442
- this.editBuffer.setCursor(eol.row, eol.col);
8470
+ const lineCount = this.editBuffer.getLineCount();
8471
+ if (cursor.col === eol.col && cursor.row < lineCount - 1) {
8472
+ this.editBuffer.setCursor(cursor.row + 1, 0);
8473
+ } else {
8474
+ this.editBuffer.setCursor(eol.row, eol.col);
8475
+ }
8443
8476
  this.updateSelectionForMovement(select, false);
8444
8477
  this.requestRender();
8445
8478
  return true;
@@ -8808,5 +8841,5 @@ export {
8808
8841
  ASCIIFont
8809
8842
  };
8810
8843
 
8811
- //# debugId=0B9337575CE949C264756E2164756E21
8844
+ //# debugId=AA9B550CE879718B64756E2164756E21
8812
8845
  //# sourceMappingURL=index.js.map