Add project text search panel
This commit is contained in:
+8
-1
@@ -138,8 +138,15 @@ pub const Session = struct {
|
||||
}
|
||||
|
||||
pub fn openFixture(self: *Session, fixture: []const u8) !void {
|
||||
try self.openFixtureAt(fixture, 0);
|
||||
}
|
||||
|
||||
pub fn openFixtureAt(self: *Session, fixture: []const u8, cursor_byte: usize) !void {
|
||||
if (self.buffer) |*buffer| buffer.deinit();
|
||||
self.buffer = try Buffer.openFromBytes(self.allocator, fixture);
|
||||
var buffer = try Buffer.openFromBytes(self.allocator, fixture);
|
||||
buffer.cursor.byte = previousBoundary(buffer.bytes.items, @min(cursor_byte, buffer.bytes.items.len));
|
||||
buffer.refreshCell();
|
||||
self.buffer = buffer;
|
||||
}
|
||||
|
||||
pub fn dispatch(self: *Session, command: Command) !void {
|
||||
|
||||
Reference in New Issue
Block a user