@opentui/core 0.1.32 → 0.1.33
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/3d.js +1 -1
- package/edit-buffer.d.ts +2 -0
- package/{index-3f9h747j.js → index-xqg0a6ka.js} +77 -16
- package/{index-3f9h747j.js.map → index-xqg0a6ka.js.map} +5 -5
- package/index.js +26 -2
- package/index.js.map +4 -4
- package/package.json +7 -7
- package/renderables/EditBufferRenderable.d.ts +2 -0
- package/testing.js +1 -1
- package/text-buffer.d.ts +1 -0
- package/zig.d.ts +4 -0
package/index.js
CHANGED
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
white,
|
|
135
135
|
wrapWithDelegates,
|
|
136
136
|
yellow
|
|
137
|
-
} from "./index-
|
|
137
|
+
} from "./index-xqg0a6ka.js";
|
|
138
138
|
// src/text-buffer-view.ts
|
|
139
139
|
class TextBufferView {
|
|
140
140
|
lib;
|
|
@@ -431,6 +431,24 @@ class EditBuffer extends EventEmitter {
|
|
|
431
431
|
this.guard();
|
|
432
432
|
return this.lib.editBufferGetLineStartOffset(this.bufferPtr, row);
|
|
433
433
|
}
|
|
434
|
+
getTextRange(startOffset, endOffset) {
|
|
435
|
+
this.guard();
|
|
436
|
+
if (startOffset >= endOffset)
|
|
437
|
+
return "";
|
|
438
|
+
const maxSize = 1024 * 1024;
|
|
439
|
+
const textBytes = this.lib.editBufferGetTextRange(this.bufferPtr, startOffset, endOffset, maxSize);
|
|
440
|
+
if (!textBytes)
|
|
441
|
+
return "";
|
|
442
|
+
return this.lib.decoder.decode(textBytes);
|
|
443
|
+
}
|
|
444
|
+
getTextRangeByCoords(startRow, startCol, endRow, endCol) {
|
|
445
|
+
this.guard();
|
|
446
|
+
const maxSize = 1024 * 1024;
|
|
447
|
+
const textBytes = this.lib.editBufferGetTextRangeByCoords(this.bufferPtr, startRow, startCol, endRow, endCol, maxSize);
|
|
448
|
+
if (!textBytes)
|
|
449
|
+
return "";
|
|
450
|
+
return this.lib.decoder.decode(textBytes);
|
|
451
|
+
}
|
|
434
452
|
debugLogRope() {
|
|
435
453
|
this.guard();
|
|
436
454
|
this.lib.editBufferDebugLogRope(this.bufferPtr);
|
|
@@ -5523,6 +5541,12 @@ class EditBufferRenderable extends Renderable {
|
|
|
5523
5541
|
this.yogaNode.markDirty();
|
|
5524
5542
|
this.requestRender();
|
|
5525
5543
|
}
|
|
5544
|
+
getTextRange(startOffset, endOffset) {
|
|
5545
|
+
return this.editBuffer.getTextRange(startOffset, endOffset);
|
|
5546
|
+
}
|
|
5547
|
+
getTextRangeByCoords(startRow, startCol, endRow, endCol) {
|
|
5548
|
+
return this.editBuffer.getTextRangeByCoords(startRow, startCol, endRow, endCol);
|
|
5549
|
+
}
|
|
5526
5550
|
}
|
|
5527
5551
|
|
|
5528
5552
|
// src/lib/keymapping.ts
|
|
@@ -6179,5 +6203,5 @@ export {
|
|
|
6179
6203
|
ASCIIFont
|
|
6180
6204
|
};
|
|
6181
6205
|
|
|
6182
|
-
//# debugId=
|
|
6206
|
+
//# debugId=1FBC3EC4899A6D8064756E2164756E21
|
|
6183
6207
|
//# sourceMappingURL=index.js.map
|