@opentui/core 0.5.12 → 0.5.13

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.
@@ -42,7 +42,7 @@ import {
42
42
  NativeMeasureTargetKind2,
43
43
  resolveRenderLib2,
44
44
  yoga_default
45
- } from "./chunk-bun-8f4q4e2m.js";
45
+ } from "./chunk-bun-sjw2d9bq.js";
46
46
 
47
47
  // src/syntax-style.ts
48
48
  function convertThemeToStyles2(theme) {
@@ -1111,8 +1111,8 @@ class Renderable2 extends BaseRenderable2 {
1111
1111
  const parentScreenY = this.parent ? this.parent._screenY : 0;
1112
1112
  this._screenX = parentScreenX + this._x + this._translateX;
1113
1113
  this._screenY = parentScreenY + this._y + this._translateY;
1114
- const newWidth = Math.max(layout.width, 1);
1115
- const newHeight = Math.max(layout.height, 1);
1114
+ const newWidth = Number.isNaN(layout.width) ? oldWidth : Math.max(layout.width, 1);
1115
+ const newHeight = Number.isNaN(layout.height) ? oldHeight : Math.max(layout.height, 1);
1116
1116
  const sizeChanged = oldWidth !== newWidth || oldHeight !== newHeight;
1117
1117
  this._widthValue = newWidth;
1118
1118
  this._heightValue = newHeight;
@@ -1844,6 +1844,7 @@ class TextBufferView2 {
1844
1844
  viewPtr;
1845
1845
  textBuffer;
1846
1846
  _destroyed = false;
1847
+ selectionClear = true;
1847
1848
  constructor(lib, ptr, textBuffer) {
1848
1849
  this.lib = lib;
1849
1850
  this.viewPtr = ptr;
@@ -1864,15 +1865,20 @@ class TextBufferView2 {
1864
1865
  }
1865
1866
  setSelection(start, end, bgColor, fgColor) {
1866
1867
  this.guard();
1868
+ this.selectionClear = false;
1867
1869
  this.lib.textBufferViewSetSelection(this.viewPtr, start, end, bgColor || null, fgColor || null);
1868
1870
  }
1869
1871
  updateSelection(end, bgColor, fgColor) {
1870
1872
  this.guard();
1873
+ this.selectionClear = false;
1871
1874
  this.lib.textBufferViewUpdateSelection(this.viewPtr, end, bgColor || null, fgColor || null);
1872
1875
  }
1873
1876
  resetSelection() {
1874
1877
  this.guard();
1878
+ if (this.selectionClear)
1879
+ return;
1875
1880
  this.lib.textBufferViewResetSelection(this.viewPtr);
1881
+ this.selectionClear = true;
1876
1882
  }
1877
1883
  getSelection() {
1878
1884
  this.guard();
@@ -1884,15 +1890,20 @@ class TextBufferView2 {
1884
1890
  }
1885
1891
  setLocalSelection(anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior = "cell") {
1886
1892
  this.guard();
1893
+ this.selectionClear = false;
1887
1894
  return this.lib.textBufferViewSetLocalSelection(this.viewPtr, anchorX, anchorY, focusX, focusY, bgColor || null, fgColor || null, behavior);
1888
1895
  }
1889
1896
  updateLocalSelection(anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior = "cell") {
1890
1897
  this.guard();
1898
+ this.selectionClear = false;
1891
1899
  return this.lib.textBufferViewUpdateLocalSelection(this.viewPtr, anchorX, anchorY, focusX, focusY, bgColor || null, fgColor || null, behavior);
1892
1900
  }
1893
1901
  resetLocalSelection() {
1894
1902
  this.guard();
1903
+ if (this.selectionClear)
1904
+ return;
1895
1905
  this.lib.textBufferViewResetLocalSelection(this.viewPtr);
1906
+ this.selectionClear = true;
1896
1907
  }
1897
1908
  setSelectionOccupancy(occupancy) {
1898
1909
  this.guard();
@@ -10503,5 +10514,5 @@ Captured external output:
10503
10514
 
10504
10515
  export { convertThemeToStyles2, SyntaxStyle2, h2, isVNode2, maybeMakeRenderable2, wrapWithDelegates2, instantiate2, delegate2, LayoutEvents2, RenderableEvents2, isRenderable2, BaseRenderable2, Renderable2, RootRenderable2, TextBufferView2, EditBuffer2, EditorView2, ANSI, BoxRenderable2, TextBufferRenderable2, CodeRenderable2, isTextNodeRenderable2, TextNodeRenderable2, RootTextNodeRenderable2, TextRenderable2, NativeSpanFeed2, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture2, ConsolePosition2, TerminalConsole2, getObjectsInViewport, EditBufferRenderableEvents2, isEditBufferRenderable2, EditBufferRenderable2, buildKittyKeyboardFlags2, MouseEvent2, MouseButton2, createCliRenderer2, CliRenderEvents2, RendererControlState2, CliRenderer2 };
10505
10516
 
10506
- //# debugId=445D1A23AA42892B64756E2164756E21
10507
- //# sourceMappingURL=chunk-bun-91mz470w.js.map
10517
+ //# debugId=A0D29EC1353CA6F964756E2164756E21
10518
+ //# sourceMappingURL=chunk-bun-awdjbppg.js.map