summaryrefslogtreecommitdiff
path: root/txt.c
diff options
context:
space:
mode:
Diffstat (limited to 'txt.c')
-rw-r--r--txt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/txt.c b/txt.c
index b3074aa..38f34c4 100644
--- a/txt.c
+++ b/txt.c
@@ -215,11 +215,11 @@ u32 txt_chr(Txt *t, TxtLoc l) {
TxtLoc txt_at(Txt *b, u32 cur) {
for (u32 i = 0; i < b->ptbl.n; i++) {
if (cur < b->ptbl.v[i].n) {
- return (TxtLoc) { i, cur };
+ return (TxtLoc) { b, i, cur };
}
cur -= b->ptbl.v[i].n;
}
- return (TxtLoc) { b->ptbl.n - 1, b->ptbl.v[b->ptbl.n - 1].n };
+ return (TxtLoc) { b, b->ptbl.n - 1, b->ptbl.v[b->ptbl.n - 1].n };
}
u32 txt_ofs(Txt *b, TxtLoc l) {
@@ -244,11 +244,11 @@ TxtLoc txt_next(Txt *b, TxtLoc l) {
TxtLoc txt_prev(Txt *b, TxtLoc l) {
if (l.i > 0) {
- return (TxtLoc) { l.p, l.i - 1 };
+ return (TxtLoc) { b, l.p, l.i - 1 };
} else if (l.p > 0) {
- return (TxtLoc) { l.p - 1, b->ptbl.v[l.p - 1].n - 1 };
+ return (TxtLoc) { b, l.p - 1, b->ptbl.v[l.p - 1].n - 1 };
} else {
- return (TxtLoc) { 0, 0 };
+ return (TxtLoc) { b, 0, 0 };
}
}