aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-20 22:37:15 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-20 22:37:15 +0100
commit4f0524c199902b5e363b63c8df40e03ecc2e069b (patch)
tree4cdc56b16ca922d0ccc847e0094759861e348981 /src/server/buffer.nim
parent322ad2bc22914e502f0dff5fc524610b8c648526 (diff)
downloadchawan-4f0524c199902b5e363b63c8df40e03ecc2e069b.tar.gz
box: InlineFragment -> InlineBox
It was named "fragment" mainly because I added it back when there was still a separate InlineBox type and I needed another name. Now InlineBox is gone, and I'm tired of typing fragment.
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r--src/server/buffer.nim14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index bb2ab92c..474c1bd3 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -687,18 +687,18 @@ type GotoAnchorResult* = object
proc findAnchor(box: BlockBox; anchor: Element): Offset
-proc findAnchor(fragment: InlineFragment; anchor: Element): Offset =
- if fragment.t == iftBox:
- let off = fragment.box.findAnchor(anchor)
+proc findAnchor(box: InlineBox; anchor: Element): Offset =
+ if box.t == ibtBox:
+ let off = box.box.findAnchor(anchor)
if off.y >= 0:
return off
- elif fragment.t == iftParent:
- for child in fragment.children:
+ elif box.t == ibtParent:
+ for child in box.children:
let off = child.findAnchor(anchor)
if off.y >= 0:
return off
- if fragment.node != nil and fragment.node.node == anchor:
- return fragment.render.offset
+ if box.node != nil and box.node.node == anchor:
+ return box.render.offset
return offset(-1, -1)
proc findAnchor(box: BlockBox; anchor: Element): Offset =