diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-02 21:40:14 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-02 21:40:14 +0100 |
commit | a13955ef170b64f27fc83e67b30b83bb56624a19 (patch) | |
tree | fd0bd72cc99b480c07e3289b103dd89b6c910fa6 /src/display | |
parent | 62983cdc609aacc47ade0a8a4a4c6b85dd26199a (diff) | |
download | chawan-a13955ef170b64f27fc83e67b30b83bb56624a19.tar.gz |
container, pager: work around bad codegen
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/pager.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/display/pager.nim b/src/display/pager.nim index 4ffd2900..47845956 100644 --- a/src/display/pager.nim +++ b/src/display/pager.nim @@ -365,10 +365,10 @@ proc addContainer*(pager: Pager, container: Container) = pager.registerContainer(container) pager.setContainer(container) -proc dupeContainer(pager: Pager, container: Container, location: Option[URL]): Container = - return pager.dispatcher.dupeBuffer(container, pager.config, location) +proc dupeContainer(pager: Pager, container: Container, location: URL): Container = + return pager.dispatcher.dupeBuffer(container, pager.config, location, "") -proc dupeBuffer*(pager: Pager, location = none(URL)) {.jsfunc.} = +proc dupeBuffer*(pager: Pager, location: URL = nil) {.jsfunc.} = pager.addContainer(pager.dupeContainer(pager.container, location)) # The prevBuffer and nextBuffer procedures emulate w3m's PREV and NEXT @@ -493,10 +493,10 @@ proc toggleSource(pager: Pager) {.jsfunc.} = pager.setContainer(pager.container.sourcepair) else: let contenttype = if pager.container.contenttype.get("") == "text/html": - some("text/plain") + "text/plain" else: - some("text/html") - let container = pager.dispatcher.dupeBuffer(pager.container, pager.config, contenttype = contenttype) + "text/html" + let container = pager.dispatcher.dupeBuffer(pager.container, pager.config, nil, contenttype) container.sourcepair = pager.container pager.container.sourcepair = container pager.addContainer(container) @@ -780,7 +780,7 @@ proc handleEvent0(pager: Pager, container: Container, event: ContainerEvent): bo of ANCHOR: var url2 = newURL(container.source.location) url2.hash(event.anchor) - pager.addContainer(pager.dupeContainer(container, some(url2))) + pager.addContainer(pager.dupeContainer(container, url2)) of NO_ANCHOR: pager.alert("Couldn't find anchor " & event.anchor) of UPDATE: |