@opentui/core 0.3.1 → 0.3.3

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.
@@ -11459,6 +11459,7 @@ class OptimizedBuffer {
11459
11459
  }
11460
11460
  }
11461
11461
  fillRect(x, y, width, height, bg2) {
11462
+ this.guard();
11462
11463
  this.lib.bufferFillRect(this.bufferPtr, x, y, width, height, bg2);
11463
11464
  }
11464
11465
  colorMatrix(matrix, cellMask, strength = 1, target = 3 /* Both */) {
@@ -11484,6 +11485,7 @@ class OptimizedBuffer {
11484
11485
  if (this._destroyed)
11485
11486
  return;
11486
11487
  this._destroyed = true;
11488
+ this._rawBuffers = null;
11487
11489
  this.lib.destroyOptimizedBuffer(this.bufferPtr);
11488
11490
  }
11489
11491
  drawTextBuffer(textBufferView, x, y) {
@@ -11524,7 +11526,7 @@ class OptimizedBuffer {
11524
11526
  const style = parseBorderStyle(options.borderStyle, "single");
11525
11527
  const borderChars = options.customBorderChars ?? BorderCharArrays[style];
11526
11528
  const packedOptions = packDrawOptions(options.border, options.shouldFill ?? false, options.titleAlignment || "left", options.bottomTitleAlignment || "left");
11527
- this.lib.bufferDrawBox(this.bufferPtr, options.x, options.y, options.width, options.height, borderChars, packedOptions, options.borderColor, options.backgroundColor, options.title ?? null, options.bottomTitle ?? null);
11529
+ this.lib.bufferDrawBox(this.bufferPtr, options.x, options.y, options.width, options.height, borderChars, packedOptions, options.borderColor, options.backgroundColor, options.titleColor ?? options.borderColor, options.title ?? null, options.bottomTitle ?? null);
11528
11530
  }
11529
11531
  pushScissorRect(x, y, width, height) {
11530
11532
  this.guard();
@@ -12525,7 +12527,51 @@ var AudioStatsStruct = defineStruct([
12525
12527
  ]);
12526
12528
 
12527
12529
  // src/zig.ts
12528
- var nativePackage = await import(`@opentui/core-${process.platform}-${process.arch}`);
12530
+ registerEnvVar({
12531
+ name: "OPENTUI_LIBC",
12532
+ description: "Select Linux native libc package. Supported values: glibc, musl.",
12533
+ type: "string",
12534
+ default: ""
12535
+ });
12536
+ function validateLinuxLibcOverride() {
12537
+ const libc = process.env.OPENTUI_LIBC;
12538
+ if (libc === undefined || libc === "" || libc === "glibc" || libc === "musl")
12539
+ return;
12540
+ throw new Error(`On Linux, OPENTUI_LIBC must be unset, empty, "glibc", or "musl", got "${libc}"`);
12541
+ }
12542
+ async function resolveNativePackage() {
12543
+ if (process.platform === "darwin") {
12544
+ if (process.arch === "x64")
12545
+ return await import("@opentui/core-darwin-x64");
12546
+ if (process.arch === "arm64")
12547
+ return await import("@opentui/core-darwin-arm64");
12548
+ }
12549
+ if (process.platform === "linux") {
12550
+ validateLinuxLibcOverride();
12551
+ if (process.arch === "x64") {
12552
+ if (process.env.OPENTUI_LIBC === "musl") {
12553
+ return await import("@opentui/core-linux-x64-musl");
12554
+ } else {
12555
+ return await import("@opentui/core-linux-x64");
12556
+ }
12557
+ }
12558
+ if (process.arch === "arm64") {
12559
+ if (process.env.OPENTUI_LIBC === "musl") {
12560
+ return await import("@opentui/core-linux-arm64-musl");
12561
+ } else {
12562
+ return await import("@opentui/core-linux-arm64");
12563
+ }
12564
+ }
12565
+ }
12566
+ if (process.platform === "win32") {
12567
+ if (process.arch === "x64")
12568
+ return await import("@opentui/core-win32-x64");
12569
+ if (process.arch === "arm64")
12570
+ return await import("@opentui/core-win32-arm64");
12571
+ }
12572
+ throw new Error(`opentui is not supported on the current platform: ${process.platform}-${process.arch}`);
12573
+ }
12574
+ var nativePackage = await resolveNativePackage();
12529
12575
  var targetLibPath = nativePackage.default;
12530
12576
  if (isBunfsPath(targetLibPath)) {
12531
12577
  targetLibPath = targetLibPath.replace("../", "");
@@ -12593,190 +12639,190 @@ function getOpenTUILib(libPath) {
12593
12639
  },
12594
12640
  createEventSink: {
12595
12641
  args: ["ptr"],
12596
- returns: "ptr"
12642
+ returns: "u32"
12597
12643
  },
12598
12644
  destroyEventSink: {
12599
- args: ["ptr"],
12645
+ args: ["u32"],
12600
12646
  returns: "void"
12601
12647
  },
12602
12648
  createRenderer: {
12603
12649
  args: ["u32", "u32", "u8", "u8", "ptr"],
12604
- returns: "ptr"
12650
+ returns: "u32"
12605
12651
  },
12606
12652
  setTerminalEnvVar: {
12607
- args: ["ptr", "ptr", "usize", "ptr", "usize"],
12653
+ args: ["u32", "ptr", "usize", "ptr", "usize"],
12608
12654
  returns: "bool"
12609
12655
  },
12610
12656
  destroyRenderer: {
12611
- args: ["ptr"],
12657
+ args: ["u32"],
12612
12658
  returns: "void"
12613
12659
  },
12614
12660
  setUseThread: {
12615
- args: ["ptr", "bool"],
12661
+ args: ["u32", "bool"],
12616
12662
  returns: "void"
12617
12663
  },
12618
12664
  setClearOnShutdown: {
12619
- args: ["ptr", "bool"],
12665
+ args: ["u32", "bool"],
12620
12666
  returns: "void"
12621
12667
  },
12622
12668
  setBackgroundColor: {
12623
- args: ["ptr", "ptr"],
12669
+ args: ["u32", "ptr"],
12624
12670
  returns: "void"
12625
12671
  },
12626
12672
  setRenderOffset: {
12627
- args: ["ptr", "u32"],
12673
+ args: ["u32", "u32"],
12628
12674
  returns: "void"
12629
12675
  },
12630
12676
  resetSplitScrollback: {
12631
- args: ["ptr", "u32", "u32"],
12677
+ args: ["u32", "u32", "u32"],
12632
12678
  returns: "u32"
12633
12679
  },
12634
12680
  syncSplitScrollback: {
12635
- args: ["ptr", "u32"],
12681
+ args: ["u32", "u32"],
12636
12682
  returns: "u32"
12637
12683
  },
12638
12684
  getSplitOutputOffset: {
12639
- args: ["ptr", "u32"],
12685
+ args: ["u32", "u32"],
12640
12686
  returns: "u32"
12641
12687
  },
12642
12688
  setPendingSplitFooterTransition: {
12643
- args: ["ptr", "u8", "u32", "u32", "u32", "u32", "u32"],
12689
+ args: ["u32", "u8", "u32", "u32", "u32", "u32", "u32"],
12644
12690
  returns: "void"
12645
12691
  },
12646
12692
  clearPendingSplitFooterTransition: {
12647
- args: ["ptr"],
12693
+ args: ["u32"],
12648
12694
  returns: "void"
12649
12695
  },
12650
12696
  updateStats: {
12651
- args: ["ptr", "f64", "u32", "f64"],
12697
+ args: ["u32", "f64", "u32", "f64"],
12652
12698
  returns: "void"
12653
12699
  },
12654
12700
  updateMemoryStats: {
12655
- args: ["ptr", "u32", "u32", "u32"],
12701
+ args: ["u32", "u32", "u32", "u32"],
12656
12702
  returns: "void"
12657
12703
  },
12658
12704
  getRenderStats: {
12659
- args: ["ptr", "ptr"],
12705
+ args: ["u32", "ptr"],
12660
12706
  returns: "void"
12661
12707
  },
12662
12708
  render: {
12663
- args: ["ptr", "bool"],
12709
+ args: ["u32", "bool"],
12664
12710
  returns: "u8"
12665
12711
  },
12666
12712
  repaintSplitFooter: {
12667
- args: ["ptr", "u32", "bool"],
12713
+ args: ["u32", "u32", "bool"],
12668
12714
  returns: "u64"
12669
12715
  },
12670
12716
  commitSplitFooterSnapshot: {
12671
- args: ["ptr", "ptr", "u32", "bool", "bool", "u32", "bool", "bool", "bool"],
12717
+ args: ["u32", "u32", "u32", "bool", "bool", "u32", "bool", "bool", "bool"],
12672
12718
  returns: "u64"
12673
12719
  },
12674
12720
  getNextBuffer: {
12675
- args: ["ptr"],
12676
- returns: "ptr"
12721
+ args: ["u32"],
12722
+ returns: "u32"
12677
12723
  },
12678
12724
  getCurrentBuffer: {
12679
- args: ["ptr"],
12680
- returns: "ptr"
12725
+ args: ["u32"],
12726
+ returns: "u32"
12681
12727
  },
12682
12728
  rendererSetPaletteState: {
12683
- args: ["ptr", "ptr", "usize", "ptr", "ptr", "u32"],
12729
+ args: ["u32", "ptr", "usize", "ptr", "ptr", "u32"],
12684
12730
  returns: "void"
12685
12731
  },
12686
12732
  queryPixelResolution: {
12687
- args: ["ptr"],
12733
+ args: ["u32"],
12688
12734
  returns: "void"
12689
12735
  },
12690
12736
  queryThemeColors: {
12691
- args: ["ptr"],
12737
+ args: ["u32"],
12692
12738
  returns: "void"
12693
12739
  },
12694
12740
  createOptimizedBuffer: {
12695
12741
  args: ["u32", "u32", "bool", "u8", "ptr", "usize"],
12696
- returns: "ptr"
12742
+ returns: "u32"
12697
12743
  },
12698
12744
  destroyOptimizedBuffer: {
12699
- args: ["ptr"],
12745
+ args: ["u32"],
12700
12746
  returns: "void"
12701
12747
  },
12702
12748
  drawFrameBuffer: {
12703
- args: ["ptr", "i32", "i32", "ptr", "u32", "u32", "u32", "u32"],
12749
+ args: ["u32", "i32", "i32", "u32", "u32", "u32", "u32", "u32"],
12704
12750
  returns: "void"
12705
12751
  },
12706
12752
  getBufferWidth: {
12707
- args: ["ptr"],
12753
+ args: ["u32"],
12708
12754
  returns: "u32"
12709
12755
  },
12710
12756
  getBufferHeight: {
12711
- args: ["ptr"],
12757
+ args: ["u32"],
12712
12758
  returns: "u32"
12713
12759
  },
12714
12760
  bufferClear: {
12715
- args: ["ptr", "ptr"],
12761
+ args: ["u32", "ptr"],
12716
12762
  returns: "void"
12717
12763
  },
12718
12764
  bufferGetCharPtr: {
12719
- args: ["ptr"],
12765
+ args: ["u32"],
12720
12766
  returns: "ptr"
12721
12767
  },
12722
12768
  bufferGetFgPtr: {
12723
- args: ["ptr"],
12769
+ args: ["u32"],
12724
12770
  returns: "ptr"
12725
12771
  },
12726
12772
  bufferGetBgPtr: {
12727
- args: ["ptr"],
12773
+ args: ["u32"],
12728
12774
  returns: "ptr"
12729
12775
  },
12730
12776
  bufferGetAttributesPtr: {
12731
- args: ["ptr"],
12777
+ args: ["u32"],
12732
12778
  returns: "ptr"
12733
12779
  },
12734
12780
  bufferGetRespectAlpha: {
12735
- args: ["ptr"],
12781
+ args: ["u32"],
12736
12782
  returns: "bool"
12737
12783
  },
12738
12784
  bufferSetRespectAlpha: {
12739
- args: ["ptr", "bool"],
12785
+ args: ["u32", "bool"],
12740
12786
  returns: "void"
12741
12787
  },
12742
12788
  bufferGetId: {
12743
- args: ["ptr", "ptr", "usize"],
12789
+ args: ["u32", "ptr", "usize"],
12744
12790
  returns: "usize"
12745
12791
  },
12746
12792
  bufferGetRealCharSize: {
12747
- args: ["ptr"],
12793
+ args: ["u32"],
12748
12794
  returns: "u32"
12749
12795
  },
12750
12796
  bufferWriteResolvedChars: {
12751
- args: ["ptr", "ptr", "usize", "bool"],
12797
+ args: ["u32", "ptr", "usize", "bool"],
12752
12798
  returns: "u32"
12753
12799
  },
12754
12800
  bufferDrawText: {
12755
- args: ["ptr", "ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
12801
+ args: ["u32", "ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
12756
12802
  returns: "void"
12757
12803
  },
12758
12804
  bufferSetCellWithAlphaBlending: {
12759
- args: ["ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
12805
+ args: ["u32", "u32", "u32", "u32", "ptr", "ptr", "u32"],
12760
12806
  returns: "void"
12761
12807
  },
12762
12808
  bufferSetCell: {
12763
- args: ["ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
12809
+ args: ["u32", "u32", "u32", "u32", "ptr", "ptr", "u32"],
12764
12810
  returns: "void"
12765
12811
  },
12766
12812
  bufferFillRect: {
12767
- args: ["ptr", "u32", "u32", "u32", "u32", "ptr"],
12813
+ args: ["u32", "u32", "u32", "u32", "u32", "ptr"],
12768
12814
  returns: "void"
12769
12815
  },
12770
12816
  bufferColorMatrix: {
12771
- args: ["ptr", "ptr", "ptr", "usize", "f32", "u8"],
12817
+ args: ["u32", "ptr", "ptr", "usize", "f32", "u8"],
12772
12818
  returns: "void"
12773
12819
  },
12774
12820
  bufferColorMatrixUniform: {
12775
- args: ["ptr", "ptr", "f32", "u8"],
12821
+ args: ["u32", "ptr", "f32", "u8"],
12776
12822
  returns: "void"
12777
12823
  },
12778
12824
  bufferResize: {
12779
- args: ["ptr", "u32", "u32"],
12825
+ args: ["u32", "u32", "u32"],
12780
12826
  returns: "void"
12781
12827
  },
12782
12828
  linkAlloc: {
@@ -12796,303 +12842,303 @@ function getOpenTUILib(libPath) {
12796
12842
  returns: "u32"
12797
12843
  },
12798
12844
  resizeRenderer: {
12799
- args: ["ptr", "u32", "u32"],
12845
+ args: ["u32", "u32", "u32"],
12800
12846
  returns: "void"
12801
12847
  },
12802
12848
  setCursorPosition: {
12803
- args: ["ptr", "i32", "i32", "bool"],
12849
+ args: ["u32", "i32", "i32", "bool"],
12804
12850
  returns: "void"
12805
12851
  },
12806
12852
  setCursorColor: {
12807
- args: ["ptr", "ptr"],
12853
+ args: ["u32", "ptr"],
12808
12854
  returns: "void"
12809
12855
  },
12810
12856
  getCursorState: {
12811
- args: ["ptr", "ptr"],
12857
+ args: ["u32", "ptr"],
12812
12858
  returns: "void"
12813
12859
  },
12814
12860
  setCursorStyleOptions: {
12815
- args: ["ptr", "ptr"],
12861
+ args: ["u32", "ptr"],
12816
12862
  returns: "void"
12817
12863
  },
12818
12864
  setDebugOverlay: {
12819
- args: ["ptr", "bool", "u8"],
12865
+ args: ["u32", "bool", "u8"],
12820
12866
  returns: "void"
12821
12867
  },
12822
12868
  clearTerminal: {
12823
- args: ["ptr"],
12869
+ args: ["u32"],
12824
12870
  returns: "void"
12825
12871
  },
12826
12872
  setTerminalTitle: {
12827
- args: ["ptr", "ptr", "usize"],
12873
+ args: ["u32", "ptr", "usize"],
12828
12874
  returns: "void"
12829
12875
  },
12830
12876
  copyToClipboardOSC52: {
12831
- args: ["ptr", "u8", "ptr", "usize"],
12877
+ args: ["u32", "u8", "ptr", "usize"],
12832
12878
  returns: "bool"
12833
12879
  },
12834
12880
  clearClipboardOSC52: {
12835
- args: ["ptr", "u8"],
12881
+ args: ["u32", "u8"],
12836
12882
  returns: "bool"
12837
12883
  },
12838
12884
  triggerNotification: {
12839
- args: ["ptr", "ptr", "usize", "ptr", "usize"],
12885
+ args: ["u32", "ptr", "usize", "ptr", "usize"],
12840
12886
  returns: "bool"
12841
12887
  },
12842
12888
  bufferDrawSuperSampleBuffer: {
12843
- args: ["ptr", "u32", "u32", "ptr", "usize", "u8", "u32"],
12889
+ args: ["u32", "u32", "u32", "ptr", "usize", "u8", "u32"],
12844
12890
  returns: "void"
12845
12891
  },
12846
12892
  bufferDrawPackedBuffer: {
12847
- args: ["ptr", "ptr", "usize", "u32", "u32", "u32", "u32"],
12893
+ args: ["u32", "ptr", "usize", "u32", "u32", "u32", "u32"],
12848
12894
  returns: "void"
12849
12895
  },
12850
12896
  bufferDrawGrayscaleBuffer: {
12851
- args: ["ptr", "i32", "i32", "ptr", "u32", "u32", "ptr", "ptr"],
12897
+ args: ["u32", "i32", "i32", "ptr", "u32", "u32", "ptr", "ptr"],
12852
12898
  returns: "void"
12853
12899
  },
12854
12900
  bufferDrawGrayscaleBufferSupersampled: {
12855
- args: ["ptr", "i32", "i32", "ptr", "u32", "u32", "ptr", "ptr"],
12901
+ args: ["u32", "i32", "i32", "ptr", "u32", "u32", "ptr", "ptr"],
12856
12902
  returns: "void"
12857
12903
  },
12858
12904
  bufferDrawGrid: {
12859
- args: ["ptr", "ptr", "ptr", "ptr", "ptr", "u32", "ptr", "u32", "ptr"],
12905
+ args: ["u32", "ptr", "ptr", "ptr", "ptr", "u32", "ptr", "u32", "ptr"],
12860
12906
  returns: "void"
12861
12907
  },
12862
12908
  bufferDrawBox: {
12863
- args: ["ptr", "i32", "i32", "u32", "u32", "ptr", "u32", "ptr", "ptr", "ptr", "u32", "ptr", "u32"],
12909
+ args: ["u32", "i32", "i32", "u32", "u32", "ptr", "u32", "ptr", "ptr", "ptr", "ptr", "u32", "ptr", "u32"],
12864
12910
  returns: "void"
12865
12911
  },
12866
12912
  bufferPushScissorRect: {
12867
- args: ["ptr", "i32", "i32", "u32", "u32"],
12913
+ args: ["u32", "i32", "i32", "u32", "u32"],
12868
12914
  returns: "void"
12869
12915
  },
12870
12916
  bufferPopScissorRect: {
12871
- args: ["ptr"],
12917
+ args: ["u32"],
12872
12918
  returns: "void"
12873
12919
  },
12874
12920
  bufferClearScissorRects: {
12875
- args: ["ptr"],
12921
+ args: ["u32"],
12876
12922
  returns: "void"
12877
12923
  },
12878
12924
  bufferPushOpacity: {
12879
- args: ["ptr", "f32"],
12925
+ args: ["u32", "f32"],
12880
12926
  returns: "void"
12881
12927
  },
12882
12928
  bufferPopOpacity: {
12883
- args: ["ptr"],
12929
+ args: ["u32"],
12884
12930
  returns: "void"
12885
12931
  },
12886
12932
  bufferGetCurrentOpacity: {
12887
- args: ["ptr"],
12933
+ args: ["u32"],
12888
12934
  returns: "f32"
12889
12935
  },
12890
12936
  bufferClearOpacity: {
12891
- args: ["ptr"],
12937
+ args: ["u32"],
12892
12938
  returns: "void"
12893
12939
  },
12894
12940
  addToHitGrid: {
12895
- args: ["ptr", "i32", "i32", "u32", "u32", "u32"],
12941
+ args: ["u32", "i32", "i32", "u32", "u32", "u32"],
12896
12942
  returns: "void"
12897
12943
  },
12898
12944
  clearCurrentHitGrid: {
12899
- args: ["ptr"],
12945
+ args: ["u32"],
12900
12946
  returns: "void"
12901
12947
  },
12902
12948
  hitGridPushScissorRect: {
12903
- args: ["ptr", "i32", "i32", "u32", "u32"],
12949
+ args: ["u32", "i32", "i32", "u32", "u32"],
12904
12950
  returns: "void"
12905
12951
  },
12906
12952
  hitGridPopScissorRect: {
12907
- args: ["ptr"],
12953
+ args: ["u32"],
12908
12954
  returns: "void"
12909
12955
  },
12910
12956
  hitGridClearScissorRects: {
12911
- args: ["ptr"],
12957
+ args: ["u32"],
12912
12958
  returns: "void"
12913
12959
  },
12914
12960
  addToCurrentHitGridClipped: {
12915
- args: ["ptr", "i32", "i32", "u32", "u32", "u32"],
12961
+ args: ["u32", "i32", "i32", "u32", "u32", "u32"],
12916
12962
  returns: "void"
12917
12963
  },
12918
12964
  checkHit: {
12919
- args: ["ptr", "u32", "u32"],
12965
+ args: ["u32", "u32", "u32"],
12920
12966
  returns: "u32"
12921
12967
  },
12922
12968
  getHitGridDirty: {
12923
- args: ["ptr"],
12969
+ args: ["u32"],
12924
12970
  returns: "bool"
12925
12971
  },
12926
12972
  dumpHitGrid: {
12927
- args: ["ptr"],
12973
+ args: ["u32"],
12928
12974
  returns: "void"
12929
12975
  },
12930
12976
  dumpBuffers: {
12931
- args: ["ptr", "i64"],
12977
+ args: ["u32", "i64"],
12932
12978
  returns: "void"
12933
12979
  },
12934
12980
  dumpOutputBuffer: {
12935
- args: ["ptr", "i64"],
12981
+ args: ["u32", "i64"],
12936
12982
  returns: "void"
12937
12983
  },
12938
12984
  restoreTerminalModes: {
12939
- args: ["ptr"],
12985
+ args: ["u32"],
12940
12986
  returns: "void"
12941
12987
  },
12942
12988
  enableMouse: {
12943
- args: ["ptr", "bool"],
12989
+ args: ["u32", "bool"],
12944
12990
  returns: "void"
12945
12991
  },
12946
12992
  disableMouse: {
12947
- args: ["ptr"],
12993
+ args: ["u32"],
12948
12994
  returns: "void"
12949
12995
  },
12950
12996
  enableKittyKeyboard: {
12951
- args: ["ptr", "u8"],
12997
+ args: ["u32", "u8"],
12952
12998
  returns: "void"
12953
12999
  },
12954
13000
  disableKittyKeyboard: {
12955
- args: ["ptr"],
13001
+ args: ["u32"],
12956
13002
  returns: "void"
12957
13003
  },
12958
13004
  setKittyKeyboardFlags: {
12959
- args: ["ptr", "u8"],
13005
+ args: ["u32", "u8"],
12960
13006
  returns: "void"
12961
13007
  },
12962
13008
  getKittyKeyboardFlags: {
12963
- args: ["ptr"],
13009
+ args: ["u32"],
12964
13010
  returns: "u8"
12965
13011
  },
12966
13012
  setupTerminal: {
12967
- args: ["ptr", "bool"],
13013
+ args: ["u32", "bool"],
12968
13014
  returns: "void"
12969
13015
  },
12970
13016
  suspendRenderer: {
12971
- args: ["ptr"],
13017
+ args: ["u32"],
12972
13018
  returns: "void"
12973
13019
  },
12974
13020
  resumeRenderer: {
12975
- args: ["ptr"],
13021
+ args: ["u32"],
12976
13022
  returns: "void"
12977
13023
  },
12978
13024
  writeOut: {
12979
- args: ["ptr", "ptr", "u64"],
13025
+ args: ["u32", "ptr", "u64"],
12980
13026
  returns: "void"
12981
13027
  },
12982
13028
  createTextBuffer: {
12983
13029
  args: ["u8"],
12984
- returns: "ptr"
13030
+ returns: "u32"
12985
13031
  },
12986
13032
  destroyTextBuffer: {
12987
- args: ["ptr"],
13033
+ args: ["u32"],
12988
13034
  returns: "void"
12989
13035
  },
12990
13036
  textBufferGetLength: {
12991
- args: ["ptr"],
13037
+ args: ["u32"],
12992
13038
  returns: "u32"
12993
13039
  },
12994
13040
  textBufferGetByteSize: {
12995
- args: ["ptr"],
13041
+ args: ["u32"],
12996
13042
  returns: "u32"
12997
13043
  },
12998
13044
  textBufferReset: {
12999
- args: ["ptr"],
13045
+ args: ["u32"],
13000
13046
  returns: "void"
13001
13047
  },
13002
13048
  textBufferClear: {
13003
- args: ["ptr"],
13049
+ args: ["u32"],
13004
13050
  returns: "void"
13005
13051
  },
13006
13052
  textBufferSetDefaultFg: {
13007
- args: ["ptr", "ptr"],
13053
+ args: ["u32", "ptr"],
13008
13054
  returns: "void"
13009
13055
  },
13010
13056
  textBufferSetDefaultBg: {
13011
- args: ["ptr", "ptr"],
13057
+ args: ["u32", "ptr"],
13012
13058
  returns: "void"
13013
13059
  },
13014
13060
  textBufferSetDefaultAttributes: {
13015
- args: ["ptr", "ptr"],
13061
+ args: ["u32", "ptr"],
13016
13062
  returns: "void"
13017
13063
  },
13018
13064
  textBufferResetDefaults: {
13019
- args: ["ptr"],
13065
+ args: ["u32"],
13020
13066
  returns: "void"
13021
13067
  },
13022
13068
  textBufferGetTabWidth: {
13023
- args: ["ptr"],
13069
+ args: ["u32"],
13024
13070
  returns: "u8"
13025
13071
  },
13026
13072
  textBufferSetTabWidth: {
13027
- args: ["ptr", "u8"],
13073
+ args: ["u32", "u8"],
13028
13074
  returns: "void"
13029
13075
  },
13030
13076
  textBufferRegisterMemBuffer: {
13031
- args: ["ptr", "ptr", "usize", "bool"],
13077
+ args: ["u32", "ptr", "usize", "bool"],
13032
13078
  returns: "u16"
13033
13079
  },
13034
13080
  textBufferReplaceMemBuffer: {
13035
- args: ["ptr", "u8", "ptr", "usize", "bool"],
13081
+ args: ["u32", "u8", "ptr", "usize", "bool"],
13036
13082
  returns: "bool"
13037
13083
  },
13038
13084
  textBufferClearMemRegistry: {
13039
- args: ["ptr"],
13085
+ args: ["u32"],
13040
13086
  returns: "void"
13041
13087
  },
13042
13088
  textBufferSetTextFromMem: {
13043
- args: ["ptr", "u8"],
13089
+ args: ["u32", "u8"],
13044
13090
  returns: "void"
13045
13091
  },
13046
13092
  textBufferAppend: {
13047
- args: ["ptr", "ptr", "usize"],
13093
+ args: ["u32", "ptr", "usize"],
13048
13094
  returns: "void"
13049
13095
  },
13050
13096
  textBufferAppendFromMemId: {
13051
- args: ["ptr", "u8"],
13097
+ args: ["u32", "u8"],
13052
13098
  returns: "void"
13053
13099
  },
13054
13100
  textBufferLoadFile: {
13055
- args: ["ptr", "ptr", "usize"],
13101
+ args: ["u32", "ptr", "usize"],
13056
13102
  returns: "bool"
13057
13103
  },
13058
13104
  textBufferSetStyledText: {
13059
- args: ["ptr", "ptr", "usize"],
13105
+ args: ["u32", "ptr", "usize"],
13060
13106
  returns: "void"
13061
13107
  },
13062
13108
  textBufferGetLineCount: {
13063
- args: ["ptr"],
13109
+ args: ["u32"],
13064
13110
  returns: "u32"
13065
13111
  },
13066
13112
  textBufferGetPlainText: {
13067
- args: ["ptr", "ptr", "usize"],
13113
+ args: ["u32", "ptr", "usize"],
13068
13114
  returns: "usize"
13069
13115
  },
13070
13116
  textBufferAddHighlightByCharRange: {
13071
- args: ["ptr", "ptr"],
13117
+ args: ["u32", "ptr"],
13072
13118
  returns: "void"
13073
13119
  },
13074
13120
  textBufferAddHighlight: {
13075
- args: ["ptr", "u32", "ptr"],
13121
+ args: ["u32", "u32", "ptr"],
13076
13122
  returns: "void"
13077
13123
  },
13078
13124
  textBufferRemoveHighlightsByRef: {
13079
- args: ["ptr", "u16"],
13125
+ args: ["u32", "u16"],
13080
13126
  returns: "void"
13081
13127
  },
13082
13128
  textBufferClearLineHighlights: {
13083
- args: ["ptr", "u32"],
13129
+ args: ["u32", "u32"],
13084
13130
  returns: "void"
13085
13131
  },
13086
13132
  textBufferClearAllHighlights: {
13087
- args: ["ptr"],
13133
+ args: ["u32"],
13088
13134
  returns: "void"
13089
13135
  },
13090
13136
  textBufferSetSyntaxStyle: {
13091
- args: ["ptr", "ptr"],
13137
+ args: ["u32", "u32"],
13092
13138
  returns: "void"
13093
13139
  },
13094
13140
  textBufferGetLineHighlightsPtr: {
13095
- args: ["ptr", "u32", "ptr"],
13141
+ args: ["u32", "u32", "ptr"],
13096
13142
  returns: "ptr"
13097
13143
  },
13098
13144
  textBufferFreeLineHighlights: {
@@ -13100,415 +13146,415 @@ function getOpenTUILib(libPath) {
13100
13146
  returns: "void"
13101
13147
  },
13102
13148
  textBufferGetHighlightCount: {
13103
- args: ["ptr"],
13149
+ args: ["u32"],
13104
13150
  returns: "u32"
13105
13151
  },
13106
13152
  textBufferGetTextRange: {
13107
- args: ["ptr", "u32", "u32", "ptr", "usize"],
13153
+ args: ["u32", "u32", "u32", "ptr", "usize"],
13108
13154
  returns: "usize"
13109
13155
  },
13110
13156
  textBufferGetTextRangeByCoords: {
13111
- args: ["ptr", "u32", "u32", "u32", "u32", "ptr", "usize"],
13157
+ args: ["u32", "u32", "u32", "u32", "u32", "ptr", "usize"],
13112
13158
  returns: "usize"
13113
13159
  },
13114
13160
  createTextBufferView: {
13115
- args: ["ptr"],
13116
- returns: "ptr"
13161
+ args: ["u32"],
13162
+ returns: "u32"
13117
13163
  },
13118
13164
  destroyTextBufferView: {
13119
- args: ["ptr"],
13165
+ args: ["u32"],
13120
13166
  returns: "void"
13121
13167
  },
13122
13168
  textBufferViewSetSelection: {
13123
- args: ["ptr", "u32", "u32", "ptr", "ptr"],
13169
+ args: ["u32", "u32", "u32", "ptr", "ptr"],
13124
13170
  returns: "void"
13125
13171
  },
13126
13172
  textBufferViewResetSelection: {
13127
- args: ["ptr"],
13173
+ args: ["u32"],
13128
13174
  returns: "void"
13129
13175
  },
13130
13176
  textBufferViewGetSelectionInfo: {
13131
- args: ["ptr"],
13177
+ args: ["u32"],
13132
13178
  returns: "u64"
13133
13179
  },
13134
13180
  textBufferViewSetLocalSelection: {
13135
- args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr"],
13181
+ args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr"],
13136
13182
  returns: "bool"
13137
13183
  },
13138
13184
  textBufferViewUpdateSelection: {
13139
- args: ["ptr", "u32", "ptr", "ptr"],
13185
+ args: ["u32", "u32", "ptr", "ptr"],
13140
13186
  returns: "void"
13141
13187
  },
13142
13188
  textBufferViewUpdateLocalSelection: {
13143
- args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr"],
13189
+ args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr"],
13144
13190
  returns: "bool"
13145
13191
  },
13146
13192
  textBufferViewResetLocalSelection: {
13147
- args: ["ptr"],
13193
+ args: ["u32"],
13148
13194
  returns: "void"
13149
13195
  },
13150
13196
  textBufferViewSetWrapWidth: {
13151
- args: ["ptr", "u32"],
13197
+ args: ["u32", "u32"],
13152
13198
  returns: "void"
13153
13199
  },
13154
13200
  textBufferViewSetWrapMode: {
13155
- args: ["ptr", "u8"],
13201
+ args: ["u32", "u8"],
13156
13202
  returns: "void"
13157
13203
  },
13158
13204
  textBufferViewSetFirstLineOffset: {
13159
- args: ["ptr", "u32"],
13205
+ args: ["u32", "u32"],
13160
13206
  returns: "void"
13161
13207
  },
13162
13208
  textBufferViewSetViewportSize: {
13163
- args: ["ptr", "u32", "u32"],
13209
+ args: ["u32", "u32", "u32"],
13164
13210
  returns: "void"
13165
13211
  },
13166
13212
  textBufferViewSetViewport: {
13167
- args: ["ptr", "u32", "u32", "u32", "u32"],
13213
+ args: ["u32", "u32", "u32", "u32", "u32"],
13168
13214
  returns: "void"
13169
13215
  },
13170
13216
  textBufferViewGetVirtualLineCount: {
13171
- args: ["ptr"],
13217
+ args: ["u32"],
13172
13218
  returns: "u32"
13173
13219
  },
13174
13220
  textBufferViewGetLineInfoDirect: {
13175
- args: ["ptr", "ptr"],
13221
+ args: ["u32", "ptr"],
13176
13222
  returns: "void"
13177
13223
  },
13178
13224
  textBufferViewGetLogicalLineInfoDirect: {
13179
- args: ["ptr", "ptr"],
13225
+ args: ["u32", "ptr"],
13180
13226
  returns: "void"
13181
13227
  },
13182
13228
  textBufferViewGetSelectedText: {
13183
- args: ["ptr", "ptr", "usize"],
13229
+ args: ["u32", "ptr", "usize"],
13184
13230
  returns: "usize"
13185
13231
  },
13186
13232
  textBufferViewGetPlainText: {
13187
- args: ["ptr", "ptr", "usize"],
13233
+ args: ["u32", "ptr", "usize"],
13188
13234
  returns: "usize"
13189
13235
  },
13190
13236
  textBufferViewSetTabIndicator: {
13191
- args: ["ptr", "u32"],
13237
+ args: ["u32", "u32"],
13192
13238
  returns: "void"
13193
13239
  },
13194
13240
  textBufferViewSetTabIndicatorColor: {
13195
- args: ["ptr", "ptr"],
13241
+ args: ["u32", "ptr"],
13196
13242
  returns: "void"
13197
13243
  },
13198
13244
  textBufferViewSetTruncate: {
13199
- args: ["ptr", "bool"],
13245
+ args: ["u32", "bool"],
13200
13246
  returns: "void"
13201
13247
  },
13202
13248
  textBufferViewMeasureForDimensions: {
13203
- args: ["ptr", "u32", "u32", "ptr"],
13249
+ args: ["u32", "u32", "u32", "ptr"],
13204
13250
  returns: "bool"
13205
13251
  },
13206
13252
  bufferDrawTextBufferView: {
13207
- args: ["ptr", "ptr", "i32", "i32"],
13253
+ args: ["u32", "u32", "i32", "i32"],
13208
13254
  returns: "void"
13209
13255
  },
13210
13256
  bufferDrawEditorView: {
13211
- args: ["ptr", "ptr", "i32", "i32"],
13257
+ args: ["u32", "u32", "i32", "i32"],
13212
13258
  returns: "void"
13213
13259
  },
13214
13260
  createEditorView: {
13215
- args: ["ptr", "u32", "u32"],
13216
- returns: "ptr"
13261
+ args: ["u32", "u32", "u32"],
13262
+ returns: "u32"
13217
13263
  },
13218
13264
  destroyEditorView: {
13219
- args: ["ptr"],
13265
+ args: ["u32"],
13220
13266
  returns: "void"
13221
13267
  },
13222
13268
  editorViewSetViewportSize: {
13223
- args: ["ptr", "u32", "u32"],
13269
+ args: ["u32", "u32", "u32"],
13224
13270
  returns: "void"
13225
13271
  },
13226
13272
  editorViewSetViewport: {
13227
- args: ["ptr", "u32", "u32", "u32", "u32", "bool"],
13273
+ args: ["u32", "u32", "u32", "u32", "u32", "bool"],
13228
13274
  returns: "void"
13229
13275
  },
13230
13276
  editorViewGetViewport: {
13231
- args: ["ptr", "ptr", "ptr", "ptr", "ptr"],
13277
+ args: ["u32", "ptr", "ptr", "ptr", "ptr"],
13232
13278
  returns: "void"
13233
13279
  },
13234
13280
  editorViewSetScrollMargin: {
13235
- args: ["ptr", "f32"],
13281
+ args: ["u32", "f32"],
13236
13282
  returns: "void"
13237
13283
  },
13238
13284
  editorViewSetWrapMode: {
13239
- args: ["ptr", "u8"],
13285
+ args: ["u32", "u8"],
13240
13286
  returns: "void"
13241
13287
  },
13242
13288
  editorViewGetVirtualLineCount: {
13243
- args: ["ptr"],
13289
+ args: ["u32"],
13244
13290
  returns: "u32"
13245
13291
  },
13246
13292
  editorViewGetTotalVirtualLineCount: {
13247
- args: ["ptr"],
13293
+ args: ["u32"],
13248
13294
  returns: "u32"
13249
13295
  },
13250
13296
  editorViewGetTextBufferView: {
13251
- args: ["ptr"],
13252
- returns: "ptr"
13297
+ args: ["u32"],
13298
+ returns: "u32"
13253
13299
  },
13254
13300
  editorViewGetLineInfoDirect: {
13255
- args: ["ptr", "ptr"],
13301
+ args: ["u32", "ptr"],
13256
13302
  returns: "void"
13257
13303
  },
13258
13304
  editorViewGetLogicalLineInfoDirect: {
13259
- args: ["ptr", "ptr"],
13305
+ args: ["u32", "ptr"],
13260
13306
  returns: "void"
13261
13307
  },
13262
13308
  createEditBuffer: {
13263
- args: ["u8", "ptr"],
13264
- returns: "ptr"
13309
+ args: ["u8", "u32"],
13310
+ returns: "u32"
13265
13311
  },
13266
13312
  destroyEditBuffer: {
13267
- args: ["ptr"],
13313
+ args: ["u32"],
13268
13314
  returns: "void"
13269
13315
  },
13270
13316
  editBufferSetText: {
13271
- args: ["ptr", "ptr", "usize"],
13317
+ args: ["u32", "ptr", "usize"],
13272
13318
  returns: "void"
13273
13319
  },
13274
13320
  editBufferSetTextFromMem: {
13275
- args: ["ptr", "u8"],
13321
+ args: ["u32", "u8"],
13276
13322
  returns: "void"
13277
13323
  },
13278
13324
  editBufferReplaceText: {
13279
- args: ["ptr", "ptr", "usize"],
13325
+ args: ["u32", "ptr", "usize"],
13280
13326
  returns: "void"
13281
13327
  },
13282
13328
  editBufferReplaceTextFromMem: {
13283
- args: ["ptr", "u8"],
13329
+ args: ["u32", "u8"],
13284
13330
  returns: "void"
13285
13331
  },
13286
13332
  editBufferGetText: {
13287
- args: ["ptr", "ptr", "usize"],
13333
+ args: ["u32", "ptr", "usize"],
13288
13334
  returns: "usize"
13289
13335
  },
13290
13336
  editBufferInsertChar: {
13291
- args: ["ptr", "ptr", "usize"],
13337
+ args: ["u32", "ptr", "usize"],
13292
13338
  returns: "void"
13293
13339
  },
13294
13340
  editBufferInsertText: {
13295
- args: ["ptr", "ptr", "usize"],
13341
+ args: ["u32", "ptr", "usize"],
13296
13342
  returns: "void"
13297
13343
  },
13298
13344
  editBufferDeleteChar: {
13299
- args: ["ptr"],
13345
+ args: ["u32"],
13300
13346
  returns: "void"
13301
13347
  },
13302
13348
  editBufferDeleteCharBackward: {
13303
- args: ["ptr"],
13349
+ args: ["u32"],
13304
13350
  returns: "void"
13305
13351
  },
13306
13352
  editBufferDeleteRange: {
13307
- args: ["ptr", "u32", "u32", "u32", "u32"],
13353
+ args: ["u32", "u32", "u32", "u32", "u32"],
13308
13354
  returns: "void"
13309
13355
  },
13310
13356
  editBufferNewLine: {
13311
- args: ["ptr"],
13357
+ args: ["u32"],
13312
13358
  returns: "void"
13313
13359
  },
13314
13360
  editBufferDeleteLine: {
13315
- args: ["ptr"],
13361
+ args: ["u32"],
13316
13362
  returns: "void"
13317
13363
  },
13318
13364
  editBufferMoveCursorLeft: {
13319
- args: ["ptr"],
13365
+ args: ["u32"],
13320
13366
  returns: "void"
13321
13367
  },
13322
13368
  editBufferMoveCursorRight: {
13323
- args: ["ptr"],
13369
+ args: ["u32"],
13324
13370
  returns: "void"
13325
13371
  },
13326
13372
  editBufferMoveCursorUp: {
13327
- args: ["ptr"],
13373
+ args: ["u32"],
13328
13374
  returns: "void"
13329
13375
  },
13330
13376
  editBufferMoveCursorDown: {
13331
- args: ["ptr"],
13377
+ args: ["u32"],
13332
13378
  returns: "void"
13333
13379
  },
13334
13380
  editBufferGotoLine: {
13335
- args: ["ptr", "u32"],
13381
+ args: ["u32", "u32"],
13336
13382
  returns: "void"
13337
13383
  },
13338
13384
  editBufferSetCursor: {
13339
- args: ["ptr", "u32", "u32"],
13385
+ args: ["u32", "u32", "u32"],
13340
13386
  returns: "void"
13341
13387
  },
13342
13388
  editBufferSetCursorToLineCol: {
13343
- args: ["ptr", "u32", "u32"],
13389
+ args: ["u32", "u32", "u32"],
13344
13390
  returns: "void"
13345
13391
  },
13346
13392
  editBufferSetCursorByOffset: {
13347
- args: ["ptr", "u32"],
13393
+ args: ["u32", "u32"],
13348
13394
  returns: "void"
13349
13395
  },
13350
13396
  editBufferGetCursorPosition: {
13351
- args: ["ptr", "ptr"],
13397
+ args: ["u32", "ptr"],
13352
13398
  returns: "void"
13353
13399
  },
13354
13400
  editBufferGetId: {
13355
- args: ["ptr"],
13401
+ args: ["u32"],
13356
13402
  returns: "u16"
13357
13403
  },
13358
13404
  editBufferGetTextBuffer: {
13359
- args: ["ptr"],
13360
- returns: "ptr"
13405
+ args: ["u32"],
13406
+ returns: "u32"
13361
13407
  },
13362
13408
  editBufferDebugLogRope: {
13363
- args: ["ptr"],
13409
+ args: ["u32"],
13364
13410
  returns: "void"
13365
13411
  },
13366
13412
  editBufferUndo: {
13367
- args: ["ptr", "ptr", "usize"],
13413
+ args: ["u32", "ptr", "usize"],
13368
13414
  returns: "usize"
13369
13415
  },
13370
13416
  editBufferRedo: {
13371
- args: ["ptr", "ptr", "usize"],
13417
+ args: ["u32", "ptr", "usize"],
13372
13418
  returns: "usize"
13373
13419
  },
13374
13420
  editBufferCanUndo: {
13375
- args: ["ptr"],
13421
+ args: ["u32"],
13376
13422
  returns: "bool"
13377
13423
  },
13378
13424
  editBufferCanRedo: {
13379
- args: ["ptr"],
13425
+ args: ["u32"],
13380
13426
  returns: "bool"
13381
13427
  },
13382
13428
  editBufferClearHistory: {
13383
- args: ["ptr"],
13429
+ args: ["u32"],
13384
13430
  returns: "void"
13385
13431
  },
13386
13432
  editBufferClear: {
13387
- args: ["ptr"],
13433
+ args: ["u32"],
13388
13434
  returns: "void"
13389
13435
  },
13390
13436
  editBufferGetNextWordBoundary: {
13391
- args: ["ptr", "ptr"],
13437
+ args: ["u32", "ptr"],
13392
13438
  returns: "void"
13393
13439
  },
13394
13440
  editBufferGetPrevWordBoundary: {
13395
- args: ["ptr", "ptr"],
13441
+ args: ["u32", "ptr"],
13396
13442
  returns: "void"
13397
13443
  },
13398
13444
  editBufferGetEOL: {
13399
- args: ["ptr", "ptr"],
13445
+ args: ["u32", "ptr"],
13400
13446
  returns: "void"
13401
13447
  },
13402
13448
  editBufferOffsetToPosition: {
13403
- args: ["ptr", "u32", "ptr"],
13449
+ args: ["u32", "u32", "ptr"],
13404
13450
  returns: "bool"
13405
13451
  },
13406
13452
  editBufferPositionToOffset: {
13407
- args: ["ptr", "u32", "u32"],
13453
+ args: ["u32", "u32", "u32"],
13408
13454
  returns: "u32"
13409
13455
  },
13410
13456
  editBufferGetLineStartOffset: {
13411
- args: ["ptr", "u32"],
13457
+ args: ["u32", "u32"],
13412
13458
  returns: "u32"
13413
13459
  },
13414
13460
  editBufferGetTextRange: {
13415
- args: ["ptr", "u32", "u32", "ptr", "usize"],
13461
+ args: ["u32", "u32", "u32", "ptr", "usize"],
13416
13462
  returns: "usize"
13417
13463
  },
13418
13464
  editBufferGetTextRangeByCoords: {
13419
- args: ["ptr", "u32", "u32", "u32", "u32", "ptr", "usize"],
13465
+ args: ["u32", "u32", "u32", "u32", "u32", "ptr", "usize"],
13420
13466
  returns: "usize"
13421
13467
  },
13422
13468
  editorViewSetSelection: {
13423
- args: ["ptr", "u32", "u32", "ptr", "ptr"],
13469
+ args: ["u32", "u32", "u32", "ptr", "ptr"],
13424
13470
  returns: "void"
13425
13471
  },
13426
13472
  editorViewResetSelection: {
13427
- args: ["ptr"],
13473
+ args: ["u32"],
13428
13474
  returns: "void"
13429
13475
  },
13430
13476
  editorViewGetSelection: {
13431
- args: ["ptr"],
13477
+ args: ["u32"],
13432
13478
  returns: "u64"
13433
13479
  },
13434
13480
  editorViewSetLocalSelection: {
13435
- args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool", "bool"],
13481
+ args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool", "bool"],
13436
13482
  returns: "bool"
13437
13483
  },
13438
13484
  editorViewUpdateSelection: {
13439
- args: ["ptr", "u32", "ptr", "ptr"],
13485
+ args: ["u32", "u32", "ptr", "ptr"],
13440
13486
  returns: "void"
13441
13487
  },
13442
13488
  editorViewUpdateLocalSelection: {
13443
- args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool", "bool"],
13489
+ args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool", "bool"],
13444
13490
  returns: "bool"
13445
13491
  },
13446
13492
  editorViewResetLocalSelection: {
13447
- args: ["ptr"],
13493
+ args: ["u32"],
13448
13494
  returns: "void"
13449
13495
  },
13450
13496
  editorViewGetSelectedTextBytes: {
13451
- args: ["ptr", "ptr", "usize"],
13497
+ args: ["u32", "ptr", "usize"],
13452
13498
  returns: "usize"
13453
13499
  },
13454
13500
  editorViewGetCursor: {
13455
- args: ["ptr", "ptr", "ptr"],
13501
+ args: ["u32", "ptr", "ptr"],
13456
13502
  returns: "void"
13457
13503
  },
13458
13504
  editorViewGetText: {
13459
- args: ["ptr", "ptr", "usize"],
13505
+ args: ["u32", "ptr", "usize"],
13460
13506
  returns: "usize"
13461
13507
  },
13462
13508
  editorViewGetVisualCursor: {
13463
- args: ["ptr", "ptr"],
13509
+ args: ["u32", "ptr"],
13464
13510
  returns: "void"
13465
13511
  },
13466
13512
  editorViewMoveUpVisual: {
13467
- args: ["ptr"],
13513
+ args: ["u32"],
13468
13514
  returns: "void"
13469
13515
  },
13470
13516
  editorViewMoveDownVisual: {
13471
- args: ["ptr"],
13517
+ args: ["u32"],
13472
13518
  returns: "void"
13473
13519
  },
13474
13520
  editorViewDeleteSelectedText: {
13475
- args: ["ptr"],
13521
+ args: ["u32"],
13476
13522
  returns: "void"
13477
13523
  },
13478
13524
  editorViewSetCursorByOffset: {
13479
- args: ["ptr", "u32"],
13525
+ args: ["u32", "u32"],
13480
13526
  returns: "void"
13481
13527
  },
13482
13528
  editorViewGetNextWordBoundary: {
13483
- args: ["ptr", "ptr"],
13529
+ args: ["u32", "ptr"],
13484
13530
  returns: "void"
13485
13531
  },
13486
13532
  editorViewGetPrevWordBoundary: {
13487
- args: ["ptr", "ptr"],
13533
+ args: ["u32", "ptr"],
13488
13534
  returns: "void"
13489
13535
  },
13490
13536
  editorViewGetEOL: {
13491
- args: ["ptr", "ptr"],
13537
+ args: ["u32", "ptr"],
13492
13538
  returns: "void"
13493
13539
  },
13494
13540
  editorViewGetVisualSOL: {
13495
- args: ["ptr", "ptr"],
13541
+ args: ["u32", "ptr"],
13496
13542
  returns: "void"
13497
13543
  },
13498
13544
  editorViewGetVisualEOL: {
13499
- args: ["ptr", "ptr"],
13545
+ args: ["u32", "ptr"],
13500
13546
  returns: "void"
13501
13547
  },
13502
13548
  editorViewSetPlaceholderStyledText: {
13503
- args: ["ptr", "ptr", "usize"],
13549
+ args: ["u32", "ptr", "usize"],
13504
13550
  returns: "void"
13505
13551
  },
13506
13552
  editorViewSetTabIndicator: {
13507
- args: ["ptr", "u32"],
13553
+ args: ["u32", "u32"],
13508
13554
  returns: "void"
13509
13555
  },
13510
13556
  editorViewSetTabIndicatorColor: {
13511
- args: ["ptr", "ptr"],
13557
+ args: ["u32", "ptr"],
13512
13558
  returns: "void"
13513
13559
  },
13514
13560
  getArenaAllocatedBytes: {
@@ -13525,30 +13571,30 @@ function getOpenTUILib(libPath) {
13525
13571
  },
13526
13572
  createSyntaxStyle: {
13527
13573
  args: [],
13528
- returns: "ptr"
13574
+ returns: "u32"
13529
13575
  },
13530
13576
  destroySyntaxStyle: {
13531
- args: ["ptr"],
13577
+ args: ["u32"],
13532
13578
  returns: "void"
13533
13579
  },
13534
13580
  syntaxStyleRegister: {
13535
- args: ["ptr", "ptr", "usize", "ptr", "ptr", "u32"],
13581
+ args: ["u32", "ptr", "usize", "ptr", "ptr", "u32"],
13536
13582
  returns: "u32"
13537
13583
  },
13538
13584
  syntaxStyleResolveByName: {
13539
- args: ["ptr", "ptr", "usize"],
13585
+ args: ["u32", "ptr", "usize"],
13540
13586
  returns: "u32"
13541
13587
  },
13542
13588
  syntaxStyleGetStyleCount: {
13543
- args: ["ptr"],
13589
+ args: ["u32"],
13544
13590
  returns: "usize"
13545
13591
  },
13546
13592
  getTerminalCapabilities: {
13547
- args: ["ptr", "ptr"],
13593
+ args: ["u32", "ptr"],
13548
13594
  returns: "void"
13549
13595
  },
13550
13596
  processCapabilityResponse: {
13551
- args: ["ptr", "ptr", "usize"],
13597
+ args: ["u32", "ptr", "usize"],
13552
13598
  returns: "void"
13553
13599
  },
13554
13600
  encodeUnicode: {
@@ -13560,99 +13606,99 @@ function getOpenTUILib(libPath) {
13560
13606
  returns: "void"
13561
13607
  },
13562
13608
  bufferDrawChar: {
13563
- args: ["ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
13609
+ args: ["u32", "u32", "u32", "u32", "ptr", "ptr", "u32"],
13564
13610
  returns: "void"
13565
13611
  },
13566
13612
  createAudioEngine: {
13567
13613
  args: ["ptr"],
13568
- returns: "ptr"
13614
+ returns: "u32"
13569
13615
  },
13570
13616
  destroyAudioEngine: {
13571
- args: ["ptr"],
13617
+ args: ["u32"],
13572
13618
  returns: "void"
13573
13619
  },
13574
13620
  audioRefreshPlaybackDevices: {
13575
- args: ["ptr"],
13621
+ args: ["u32"],
13576
13622
  returns: "i32"
13577
13623
  },
13578
13624
  audioGetPlaybackDeviceCount: {
13579
- args: ["ptr"],
13625
+ args: ["u32"],
13580
13626
  returns: "u32"
13581
13627
  },
13582
13628
  audioGetPlaybackDeviceName: {
13583
- args: ["ptr", "u32", "ptr", "usize"],
13629
+ args: ["u32", "u32", "ptr", "usize"],
13584
13630
  returns: "usize"
13585
13631
  },
13586
13632
  audioIsPlaybackDeviceDefault: {
13587
- args: ["ptr", "u32"],
13633
+ args: ["u32", "u32"],
13588
13634
  returns: "bool"
13589
13635
  },
13590
13636
  audioSelectPlaybackDevice: {
13591
- args: ["ptr", "u32"],
13637
+ args: ["u32", "u32"],
13592
13638
  returns: "i32"
13593
13639
  },
13594
13640
  audioClearPlaybackDeviceSelection: {
13595
- args: ["ptr"],
13641
+ args: ["u32"],
13596
13642
  returns: "void"
13597
13643
  },
13598
13644
  audioStart: {
13599
- args: ["ptr", "ptr"],
13645
+ args: ["u32", "ptr"],
13600
13646
  returns: "i32"
13601
13647
  },
13602
13648
  audioStartMixer: {
13603
- args: ["ptr"],
13649
+ args: ["u32"],
13604
13650
  returns: "i32"
13605
13651
  },
13606
13652
  audioStop: {
13607
- args: ["ptr"],
13653
+ args: ["u32"],
13608
13654
  returns: "i32"
13609
13655
  },
13610
13656
  audioLoad: {
13611
- args: ["ptr", "ptr", "u64", "ptr"],
13657
+ args: ["u32", "ptr", "u64", "ptr"],
13612
13658
  returns: "i32"
13613
13659
  },
13614
13660
  audioUnload: {
13615
- args: ["ptr", "u32"],
13661
+ args: ["u32", "u32"],
13616
13662
  returns: "i32"
13617
13663
  },
13618
13664
  audioPlay: {
13619
- args: ["ptr", "u32", "ptr", "ptr"],
13665
+ args: ["u32", "u32", "ptr", "ptr"],
13620
13666
  returns: "i32"
13621
13667
  },
13622
13668
  audioStopVoice: {
13623
- args: ["ptr", "u32"],
13669
+ args: ["u32", "u32"],
13624
13670
  returns: "i32"
13625
13671
  },
13626
13672
  audioSetVoiceGroup: {
13627
- args: ["ptr", "u32", "u32"],
13673
+ args: ["u32", "u32", "u32"],
13628
13674
  returns: "i32"
13629
13675
  },
13630
13676
  audioCreateGroup: {
13631
- args: ["ptr", "ptr", "u64", "ptr"],
13677
+ args: ["u32", "ptr", "u64", "ptr"],
13632
13678
  returns: "i32"
13633
13679
  },
13634
13680
  audioSetGroupVolume: {
13635
- args: ["ptr", "u32", "f32"],
13681
+ args: ["u32", "u32", "f32"],
13636
13682
  returns: "i32"
13637
13683
  },
13638
13684
  audioSetMasterVolume: {
13639
- args: ["ptr", "f32"],
13685
+ args: ["u32", "f32"],
13640
13686
  returns: "i32"
13641
13687
  },
13642
13688
  audioMixToBuffer: {
13643
- args: ["ptr", "ptr", "u32", "u8"],
13689
+ args: ["u32", "ptr", "u32", "u8"],
13644
13690
  returns: "i32"
13645
13691
  },
13646
13692
  audioEnableTap: {
13647
- args: ["ptr", "bool", "u32"],
13693
+ args: ["u32", "bool", "u32"],
13648
13694
  returns: "i32"
13649
13695
  },
13650
13696
  audioReadTap: {
13651
- args: ["ptr", "ptr", "u32", "u8", "ptr"],
13697
+ args: ["u32", "ptr", "u32", "u8", "ptr"],
13652
13698
  returns: "i32"
13653
13699
  },
13654
13700
  audioGetStats: {
13655
- args: ["ptr", "ptr"],
13701
+ args: ["u32", "ptr"],
13656
13702
  returns: "i32"
13657
13703
  },
13658
13704
  createNativeSpanFeed: {
@@ -13867,8 +13913,13 @@ class FFIRenderLib {
13867
13913
  nativeSpanFeedHandlers = new Map;
13868
13914
  constructor(libPath) {
13869
13915
  this.opentui = getOpenTUILib(libPath);
13870
- this.setupLogging();
13871
- this.setupEventBus();
13916
+ try {
13917
+ this.setupLogging();
13918
+ this.setupEventBus();
13919
+ } catch (error) {
13920
+ this.dispose();
13921
+ throw error;
13922
+ }
13872
13923
  }
13873
13924
  setupLogging() {
13874
13925
  if (this.logCallbackWrapper) {
@@ -13915,6 +13966,24 @@ class FFIRenderLib {
13915
13966
  setLogCallback(callbackPtr) {
13916
13967
  this.opentui.symbols.setLogCallback(callbackPtr);
13917
13968
  }
13969
+ dispose() {
13970
+ try {
13971
+ if (this.eventSinkPtr) {
13972
+ this.opentui.symbols.destroyEventSink(this.eventSinkPtr);
13973
+ this.eventSinkPtr = null;
13974
+ }
13975
+ this.setLogCallback(null);
13976
+ } finally {
13977
+ try {
13978
+ this.opentui.close();
13979
+ } finally {
13980
+ this.eventCallbackWrapper = null;
13981
+ this.logCallbackWrapper = null;
13982
+ this.nativeSpanFeedCallbackWrapper = null;
13983
+ this.nativeSpanFeedHandlers.clear();
13984
+ }
13985
+ }
13986
+ }
13918
13987
  setupEventBus() {
13919
13988
  if (this.eventCallbackWrapper) {
13920
13989
  return;
@@ -13975,7 +14044,8 @@ class FFIRenderLib {
13975
14044
  const bufferedOutputKind = options.bufferedOutput === "memory" ? 1 : 0;
13976
14045
  const remoteMode = options.remote === undefined ? 0 : options.remote ? 2 : 1;
13977
14046
  const feedPtr = options.feedPtr ?? null;
13978
- return this.opentui.symbols.createRenderer(width, height, bufferedOutputKind, remoteMode, feedPtr);
14047
+ const renderer = this.opentui.symbols.createRenderer(width, height, bufferedOutputKind, remoteMode, feedPtr);
14048
+ return renderer ? renderer : null;
13979
14049
  }
13980
14050
  setTerminalEnvVar(renderer, key, value) {
13981
14051
  const keyBytes = this.encoder.encode(key);
@@ -14163,14 +14233,14 @@ class FFIRenderLib {
14163
14233
  });
14164
14234
  this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaPtr(borderFg), rgbaPtr(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, ptr(optionsBuffer));
14165
14235
  }
14166
- bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, title, bottomTitle) {
14236
+ bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
14167
14237
  const titleBytes = title ? this.encoder.encode(title) : null;
14168
14238
  const titleLen = title ? titleBytes.length : 0;
14169
14239
  const titlePtr = title ? titleBytes : null;
14170
14240
  const bottomTitleBytes = bottomTitle ? this.encoder.encode(bottomTitle) : null;
14171
14241
  const bottomTitleLen = bottomTitle ? bottomTitleBytes.length : 0;
14172
14242
  const bottomTitlePtr = bottomTitle ? bottomTitleBytes : null;
14173
- this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, rgbaPtr(borderColor), rgbaPtr(backgroundColor), titlePtr, titleLen, bottomTitlePtr, bottomTitleLen);
14243
+ this.opentui.symbols.bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, rgbaPtr(borderColor), rgbaPtr(backgroundColor), rgbaPtr(titleColor), titlePtr, titleLen, bottomTitlePtr, bottomTitleLen);
14174
14244
  }
14175
14245
  bufferResize(buffer, width, height) {
14176
14246
  this.opentui.symbols.bufferResize(buffer, width, height);
@@ -14760,7 +14830,7 @@ class FFIRenderLib {
14760
14830
  }
14761
14831
  createEditBuffer(widthMethod) {
14762
14832
  const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
14763
- const bufferPtr = this.opentui.symbols.createEditBuffer(widthMethodCode, this.eventSinkPtr);
14833
+ const bufferPtr = this.opentui.symbols.createEditBuffer(widthMethodCode, this.eventSinkPtr ?? 0);
14764
14834
  if (!bufferPtr) {
14765
14835
  throw new Error("Failed to create EditBuffer");
14766
14836
  }
@@ -15110,8 +15180,8 @@ class FFIRenderLib {
15110
15180
  }
15111
15181
  createAudioEngine(options) {
15112
15182
  const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
15113
- const enginePtr = this.opentui.symbols.createAudioEngine(optionsBuffer ? ptr(optionsBuffer) : null);
15114
- return enginePtr ? toPointer(enginePtr) : null;
15183
+ const engineHandle = this.opentui.symbols.createAudioEngine(optionsBuffer ? ptr(optionsBuffer) : null);
15184
+ return engineHandle ? engineHandle : null;
15115
15185
  }
15116
15186
  destroyAudioEngine(engine) {
15117
15187
  this.opentui.symbols.destroyAudioEngine(engine);
@@ -15290,11 +15360,11 @@ class FFIRenderLib {
15290
15360
  return this.opentui.symbols.streamCommitReserved(stream, length);
15291
15361
  }
15292
15362
  createSyntaxStyle() {
15293
- const stylePtr = this.opentui.symbols.createSyntaxStyle();
15294
- if (!stylePtr) {
15363
+ const styleHandle = this.opentui.symbols.createSyntaxStyle();
15364
+ if (!styleHandle) {
15295
15365
  throw new Error("Failed to create SyntaxStyle");
15296
15366
  }
15297
- return stylePtr;
15367
+ return styleHandle;
15298
15368
  }
15299
15369
  destroySyntaxStyle(style) {
15300
15370
  this.opentui.symbols.destroySyntaxStyle(style);
@@ -15344,8 +15414,15 @@ class FFIRenderLib {
15344
15414
  }
15345
15415
  var opentuiLibPath;
15346
15416
  var opentuiLib;
15417
+ var renderLibResolved = false;
15347
15418
  function setRenderLibPath(libPath) {
15348
15419
  if (opentuiLibPath !== libPath) {
15420
+ if (renderLibResolved) {
15421
+ throw new Error("setRenderLibPath() must be called before resolveRenderLib()");
15422
+ }
15423
+ if (opentuiLib instanceof FFIRenderLib) {
15424
+ opentuiLib.dispose();
15425
+ }
15349
15426
  opentuiLibPath = libPath;
15350
15427
  opentuiLib = undefined;
15351
15428
  }
@@ -15358,6 +15435,7 @@ function resolveRenderLib() {
15358
15435
  throw new Error(`Failed to initialize OpenTUI render library: ${error instanceof Error ? error.message : "Unknown error"}`);
15359
15436
  }
15360
15437
  }
15438
+ renderLibResolved = true;
15361
15439
  return opentuiLib;
15362
15440
  }
15363
15441
  try {
@@ -17960,6 +18038,7 @@ class BoxRenderable extends Renderable {
17960
18038
  borderSides;
17961
18039
  shouldFill;
17962
18040
  _title;
18041
+ _titleColor;
17963
18042
  _titleAlignment;
17964
18043
  _bottomTitle;
17965
18044
  _bottomTitleAlignment;
@@ -17991,6 +18070,7 @@ class BoxRenderable extends Renderable {
17991
18070
  this.borderSides = getBorderSides(this._border);
17992
18071
  this.shouldFill = options.shouldFill ?? this._defaultOptions.shouldFill;
17993
18072
  this._title = options.title;
18073
+ this._titleColor = options.titleColor ? parseColor(options.titleColor) : undefined;
17994
18074
  this._titleAlignment = options.titleAlignment || this._defaultOptions.titleAlignment;
17995
18075
  this._bottomTitle = options.bottomTitle;
17996
18076
  this._bottomTitleAlignment = options.bottomTitleAlignment || this._defaultOptions.bottomTitleAlignment;
@@ -18081,6 +18161,16 @@ class BoxRenderable extends Renderable {
18081
18161
  this.requestRender();
18082
18162
  }
18083
18163
  }
18164
+ get titleColor() {
18165
+ return this._titleColor;
18166
+ }
18167
+ set titleColor(value) {
18168
+ const newColor = value ? parseColor(value) : undefined;
18169
+ if (this._titleColor !== newColor) {
18170
+ this._titleColor = newColor;
18171
+ this.requestRender();
18172
+ }
18173
+ }
18084
18174
  get titleAlignment() {
18085
18175
  return this._titleAlignment;
18086
18176
  }
@@ -18130,6 +18220,7 @@ class BoxRenderable extends Renderable {
18130
18220
  backgroundColor: this._backgroundColor,
18131
18221
  shouldFill: this.shouldFill,
18132
18222
  title: this._title,
18223
+ titleColor: this._titleColor ?? currentBorderColor,
18133
18224
  titleAlignment: this._titleAlignment,
18134
18225
  bottomTitle: this._bottomTitle,
18135
18226
  bottomTitleAlignment: this._bottomTitleAlignment
@@ -18583,6 +18674,8 @@ class CodeRenderable extends TextBufferRenderable {
18583
18674
  _onHighlight;
18584
18675
  _onChunks;
18585
18676
  _highlightingPromise = Promise.resolve();
18677
+ _renderedLineSources;
18678
+ _mappedLineInfo;
18586
18679
  _contentDefaultOptions = {
18587
18680
  content: "",
18588
18681
  conceal: true,
@@ -18621,9 +18714,40 @@ class CodeRenderable extends TextBufferRenderable {
18621
18714
  return;
18622
18715
  }
18623
18716
  this.textBuffer.setText(value);
18717
+ this.setRenderedLineSources(undefined);
18624
18718
  this.updateTextInfo();
18625
18719
  }
18626
18720
  }
18721
+ get lineInfo() {
18722
+ if (!this._renderedLineSources)
18723
+ return super.lineInfo;
18724
+ if (this._mappedLineInfo)
18725
+ return this._mappedLineInfo;
18726
+ const lineInfo = super.lineInfo;
18727
+ const renderedLineSources = this._renderedLineSources;
18728
+ this._mappedLineInfo = {
18729
+ ...lineInfo,
18730
+ lineSources: lineInfo.lineSources.map((line) => renderedLineSources[line] ?? line)
18731
+ };
18732
+ return this._mappedLineInfo;
18733
+ }
18734
+ get wrapMode() {
18735
+ return super.wrapMode;
18736
+ }
18737
+ set wrapMode(value) {
18738
+ if (super.wrapMode !== value) {
18739
+ this._mappedLineInfo = undefined;
18740
+ super.wrapMode = value;
18741
+ }
18742
+ }
18743
+ onResize(width, height) {
18744
+ this._mappedLineInfo = undefined;
18745
+ super.onResize(width, height);
18746
+ }
18747
+ updateTextInfo() {
18748
+ this._mappedLineInfo = undefined;
18749
+ super.updateTextInfo();
18750
+ }
18627
18751
  get filetype() {
18628
18752
  return this._filetype;
18629
18753
  }
@@ -18733,6 +18857,7 @@ class CodeRenderable extends TextBufferRenderable {
18733
18857
  this._shouldRenderTextBuffer = true;
18734
18858
  } else if (shouldDrawUnstyledNow) {
18735
18859
  this.textBuffer.setText(content);
18860
+ this.setRenderedLineSources(undefined);
18736
18861
  this._shouldRenderTextBuffer = true;
18737
18862
  } else {
18738
18863
  this._shouldRenderTextBuffer = false;
@@ -18791,6 +18916,7 @@ class CodeRenderable extends TextBufferRenderable {
18791
18916
  enabled: this._conceal,
18792
18917
  baseHighlight: this._baseHighlight
18793
18918
  });
18919
+ const renderedLineSources = this._onChunks ? undefined : this.getConcealLinesSourceMap(content, highlights);
18794
18920
  chunks = await this.transformChunks(chunks, context);
18795
18921
  if (snapshotId !== this._highlightSnapshotId) {
18796
18922
  this.requestRender();
@@ -18800,8 +18926,10 @@ class CodeRenderable extends TextBufferRenderable {
18800
18926
  return;
18801
18927
  const styledText = new StyledText(chunks);
18802
18928
  this.textBuffer.setStyledText(styledText);
18929
+ this.setRenderedLineSources(renderedLineSources);
18803
18930
  } else {
18804
18931
  this.textBuffer.setText(content);
18932
+ this.setRenderedLineSources(undefined);
18805
18933
  }
18806
18934
  this._shouldRenderTextBuffer = true;
18807
18935
  this._isHighlighting = false;
@@ -18817,6 +18945,7 @@ class CodeRenderable extends TextBufferRenderable {
18817
18945
  if (this.isDestroyed)
18818
18946
  return;
18819
18947
  this.textBuffer.setText(content);
18948
+ this.setRenderedLineSources(undefined);
18820
18949
  this._shouldRenderTextBuffer = true;
18821
18950
  this._isHighlighting = false;
18822
18951
  this._highlightsDirty = false;
@@ -18824,6 +18953,95 @@ class CodeRenderable extends TextBufferRenderable {
18824
18953
  this.requestRender();
18825
18954
  }
18826
18955
  }
18956
+ setRenderedLineSources(lineSources) {
18957
+ this._renderedLineSources = lineSources;
18958
+ this._mappedLineInfo = undefined;
18959
+ }
18960
+ static isIdentityLineSources(lineSources) {
18961
+ for (let i = 0;i < lineSources.length; i++) {
18962
+ if (lineSources[i] !== i)
18963
+ return false;
18964
+ }
18965
+ return true;
18966
+ }
18967
+ static getMergedConcealLineRanges(highlights) {
18968
+ const ranges = [];
18969
+ for (const highlight of highlights) {
18970
+ const meta = highlight[3];
18971
+ if (meta?.concealLines === undefined)
18972
+ continue;
18973
+ const group = highlight[2];
18974
+ const isEmptyConceal = meta.conceal === "" || meta.conceal === undefined && (group === "conceal" || group.startsWith("conceal."));
18975
+ if (isEmptyConceal) {
18976
+ ranges.push([highlight[0], highlight[1]]);
18977
+ }
18978
+ }
18979
+ if (ranges.length <= 1)
18980
+ return ranges;
18981
+ ranges.sort((a, b) => a[0] - b[0]);
18982
+ let writeIndex = 0;
18983
+ for (let i = 1;i < ranges.length; i++) {
18984
+ const current = ranges[writeIndex];
18985
+ const next = ranges[i];
18986
+ if (next[0] <= current[1]) {
18987
+ current[1] = Math.max(current[1], next[1]);
18988
+ } else {
18989
+ writeIndex++;
18990
+ ranges[writeIndex] = next;
18991
+ }
18992
+ }
18993
+ ranges.length = writeIndex + 1;
18994
+ return ranges;
18995
+ }
18996
+ getConcealLinesSourceMap(content, highlights) {
18997
+ if (!this._conceal || content.length === 0)
18998
+ return;
18999
+ const concealLineRanges = CodeRenderable.getMergedConcealLineRanges(highlights);
19000
+ if (concealLineRanges.length === 0)
19001
+ return;
19002
+ const lineSources = [];
19003
+ let sourceLine = 0;
19004
+ let lineStart = 0;
19005
+ let rangeIndex = 0;
19006
+ let currentRenderedLineHasText = false;
19007
+ const setCurrentRenderedLineSource = (line, hasText) => {
19008
+ if (lineSources.length === 0) {
19009
+ lineSources.push(line);
19010
+ } else if (!currentRenderedLineHasText) {
19011
+ lineSources[lineSources.length - 1] = line;
19012
+ }
19013
+ if (hasText)
19014
+ currentRenderedLineHasText = true;
19015
+ };
19016
+ while (lineStart <= content.length) {
19017
+ const newlineOffset = content.indexOf(`
19018
+ `, lineStart);
19019
+ const lineEnd = newlineOffset === -1 ? content.length : newlineOffset;
19020
+ while (rangeIndex < concealLineRanges.length && concealLineRanges[rangeIndex][1] <= lineStart) {
19021
+ rangeIndex++;
19022
+ }
19023
+ const range = concealLineRanges[rangeIndex];
19024
+ const fullyConcealed = !!range && lineEnd > lineStart && range[0] <= lineStart && range[1] >= lineEnd;
19025
+ const lineBreakConcealed = newlineOffset !== -1 && !!range && range[0] <= newlineOffset && range[1] >= newlineOffset;
19026
+ if (!fullyConcealed || !lineBreakConcealed) {
19027
+ const hasText = lineEnd > lineStart && !fullyConcealed;
19028
+ if (hasText || newlineOffset !== -1 || !fullyConcealed) {
19029
+ setCurrentRenderedLineSource(sourceLine, hasText);
19030
+ }
19031
+ if (newlineOffset !== -1 && !lineBreakConcealed) {
19032
+ lineSources.push(sourceLine + 1);
19033
+ currentRenderedLineHasText = false;
19034
+ }
19035
+ }
19036
+ sourceLine++;
19037
+ if (newlineOffset === -1)
19038
+ break;
19039
+ lineStart = newlineOffset + 1;
19040
+ }
19041
+ if (lineSources.length === 0 || CodeRenderable.isIdentityLineSources(lineSources))
19042
+ return;
19043
+ return lineSources;
19044
+ }
18827
19045
  getLineHighlights(lineIdx) {
18828
19046
  return this.textBuffer.getLineHighlights(lineIdx);
18829
19047
  }
@@ -23927,7 +24145,9 @@ Captured external output:
23927
24145
  if (this.shouldSyncNativePaletteState()) {
23928
24146
  this.refreshPalette();
23929
24147
  }
23930
- await this._feed?.idle();
24148
+ if (this._feed?.isBackpressured()) {
24149
+ await this._feed.idle();
24150
+ }
23931
24151
  }
23932
24152
  stdinListener = ((chunk) => {
23933
24153
  const data = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
@@ -25255,5 +25475,5 @@ Captured external output:
25255
25475
 
25256
25476
  export { __export, __require, MeasureMode, exports_src, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, SystemClock, nonAlphanumericKeys, terminalNamedSingleStrokeKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, stringWidth2 as stringWidth, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, detectLinks, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, TextBufferView, EditBuffer, EditorView, convertThemeToStyles, SyntaxStyle, ANSI, BoxRenderable, TextBufferRenderable, CodeRenderable, isTextNodeRenderable, TextNodeRenderable, RootTextNodeRenderable, TextRenderable, NativeSpanFeed, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, EditBufferRenderableEvents, isEditBufferRenderable, EditBufferRenderable, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
25257
25477
 
25258
- //# debugId=98141239160B854E64756E2164756E21
25259
- //# sourceMappingURL=index-jx0p1c2f.js.map
25478
+ //# debugId=A8E972EE9C6B673C64756E2164756E21
25479
+ //# sourceMappingURL=index-mn090kzf.js.map