diff options
author | bptato <nincsnevem662@gmail.com> | 2024-04-27 17:34:02 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-04-27 17:34:53 +0200 |
commit | 3f5135204c0902e2123194e0319fda7afd57bd81 (patch) | |
tree | fc9958a2c405e94419580c837c20564b08d69dd8 /src/server/buffer.nim | |
parent | 4b4b95b6e1c366fbd4e73f5bd0c0ea555bf77490 (diff) | |
download | chawan-3f5135204c0902e2123194e0319fda7afd57bd81.tar.gz |
buffer: add toggleImages
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r-- | src/server/buffer.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim index 56ad946f..1bdf1c30 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -67,7 +67,7 @@ type bcReadCanceled, bcClick, bcFindNextLink, bcFindPrevLink, bcFindNthLink, bcFindRevNthLink, bcFindNextMatch, bcFindPrevMatch, bcGetLines, bcUpdateHover, bcGotoAnchor, bcCancel, bcGetTitle, bcSelect, bcClone, - bcFindPrevParagraph, bcFindNextParagraph, bcMarkURL + bcFindPrevParagraph, bcFindNextParagraph, bcMarkURL, bcToggleImages BufferState = enum bsLoadingPage, bsLoadingResources, bsLoaded @@ -1816,6 +1816,9 @@ proc markURL*(buffer: Buffer; schemes: seq[string]) {.proxy.} = stack.add(element) buffer.do_reshape() +proc toggleImages*(buffer: Buffer) {.proxy.} = + buffer.config.images = not buffer.config.images + macro bufferDispatcher(funs: static ProxyMap; buffer: Buffer; cmd: BufferCommand; packetid: int; r: var BufferedReader) = let switch = newNimNode(nnkCaseStmt) |