aboutsummaryrefslogtreecommitdiffstats
path: root/src/local
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-20 16:46:30 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-20 16:46:30 +0100
commitee95c69e1b0d222aff9835d2bea498952e6cf29f (patch)
tree45d31975f52461259b35f1823cbef556ab410301 /src/local
parent4128dac7695a46f65e4dbb284a6e469d4338194a (diff)
downloadchawan-ee95c69e1b0d222aff9835d2bea498952e6cf29f.tar.gz
buffer: only set new buffer's target on clone
Diffstat (limited to 'src/local')
-rw-r--r--src/local/container.nim3
-rw-r--r--src/local/pager.nim11
2 files changed, 8 insertions, 6 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index 65ebf6ad..ab69a0ed 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -1484,7 +1484,8 @@ proc onload(container: Container; res: int) =
let anchor = container.url.hash.substr(1)
if anchor != "" or container.config.autofocus:
container.requestLines().then(proc(): Promise[GotoAnchorResult] =
- return container.iface.gotoAnchor(anchor, container.config.autofocus)
+ return container.iface.gotoAnchor(anchor, container.config.autofocus,
+ true)
).then(proc(res: GotoAnchorResult) =
if res.found:
container.setCursorXYCenter(res.x, res.y)
diff --git a/src/local/pager.nim b/src/local/pager.nim
index b77c85f4..72945745 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -1932,11 +1932,12 @@ proc gotoURL(pager: Pager; request: Request; prevurl = none(URL);
let container = pager.container
let url = request.url
let anchor = url.hash.substr(1)
- container.iface.gotoAnchor(anchor, false).then(proc(res: GotoAnchorResult) =
- if res.found:
- pager.dupeBuffer(container, url)
- else:
- pager.alert("Anchor " & url.hash & " not found")
+ container.iface.gotoAnchor(anchor, false, false).then(
+ proc(res: GotoAnchorResult) =
+ if res.found:
+ pager.dupeBuffer(container, url)
+ else:
+ pager.alert("Anchor " & url.hash & " not found")
)
return nil