From a4133432e47d9e45159f0ed1d4e7f6a2c02dc5b6 Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 12 Nov 2024 18:52:26 +0100 Subject: buffer: fix broken gotoAnchor behavior 23beebe6 introduced a regression that broke gotoAnchor. This fixes that, plus a couple other long-standing gotoAnchor bugs: * If no anchor is found, do not dupe the buffer. Desktop browsers still add a history entry, while w3m prints an error. I've copied the latter because it makes more sense as a user, but this will have to be refined for the navigation API at some point. * If the anchor *is* found, then always jump to it, even if it's not visible. This was a limitation of relying on the line array, so now we rely on the box tree instead. (Sooner or later, the former must go anyway.) Also, fix `U' reload not restoring the position (hopefully this time for good). --- src/css/box.nim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/css/box.nim') diff --git a/src/css/box.nim b/src/css/box.nim index a40cd4af..3d35b2ab 100644 --- a/src/css/box.nim +++ b/src/css/box.nim @@ -58,6 +58,7 @@ type InlineFragment* = ref object state*: InlineFragmentState + render*: BoxRenderState computed*: CSSComputedValues node*: StyledNode splitType*: set[SplitType] @@ -79,8 +80,12 @@ type RelativeRect* = array[DimensionType, Span] + BoxRenderState* = object + offset*: Offset + BlockBox* = ref object state*: BoxLayoutState + render*: BoxRenderState computed*: CSSComputedValues node*: StyledNode inline*: InlineFragment -- cgit