diff options
Diffstat (limited to 'core/File.zig')
| -rw-r--r-- | core/File.zig | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/core/File.zig b/core/File.zig index 1547756f..07dfa52d 100644 --- a/core/File.zig +++ b/core/File.zig @@ -108,8 +108,10 @@ pub const State = struct { // none of their bytes, and takes back what a speculation wrote // (core/rollback.zig `Epoch.wrote`). .journal = .{ "content", "line_starts" }, - // Where the view's top is, held to its text (walk.zig `.place`). - .place = .{ .{ "scroll", "lastLine" }, .{ "scroll_row", "lastRow" } }, + // Where the view's top is, held to its text (walk.zig `.place`); + // its row in that line is any (an edit leaves it past the line's + // rows, read as the last: `top`), as the session holds it. + .place = .{.{ "scroll", "lastLine" }}, }; /// The last line a view's top may be at: its text's. A clean file a @@ -121,15 +123,6 @@ pub const State = struct { return modal.lineCount(f.content) -| 1; } - /// The last row of the top's line its top may be at: a row holds a byte - /// of it at least (its rows as wrapped are the view's, made after). - pub fn lastRow(f: *const State) usize { - if (f.content.len == 0) return 0; - const at = modal.lineStartOffset(f.content, f.scroll); - const end = std.mem.indexOfScalarPos(u8, f.content, at, '\n') orelse f.content.len; - return end - at; - } - path: []u8, content: []u8, /// The bytes `content`'s buffer has room for (0: as many as it holds): |
