diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer/container.nim | 6 | ||||
-rw-r--r-- | src/display/pager.nim | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/buffer/container.nim b/src/buffer/container.nim index 570dbce8..61097186 100644 --- a/src/buffer/container.nim +++ b/src/buffer/container.nim @@ -724,11 +724,11 @@ proc reshape(container: Container): EmptyPromise {.discardable, jsfunc.} = container.setNumLines(lines) return container.requestLines()) -proc dupeBuffer*(dispatcher: Dispatcher, container: Container, config: Config, location = none(URL), contenttype = none(string)): Container = +proc dupeBuffer*(dispatcher: Dispatcher, container: Container, config: Config, location: URL, contenttype: string): Container = let source = BufferSource( t: CLONE, - location: location.get(container.source.location), - contenttype: if contenttype.isSome: contenttype else: container.contenttype, + location: if location != nil: location else: container.source.location, + contenttype: if contenttype != "": some(contenttype) else: container.contenttype, clonepid: container.process, ) container.pipeto = dispatcher.newBuffer(container.config, source, container.title) 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: |