aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-10-29 00:25:00 +0100
committerbptato <nincsnevem662@gmail.com>2024-10-29 00:30:12 +0100
commitd9a74dbdeef846a98a464bfc102ce282b45e9606 (patch)
treea9a4c9d18c52b930561bcae2fc61e0e704cfc7d5 /src
parent7d17ba81a846d4a6081aed0726a57c14d635de87 (diff)
downloadchawan-d9a74dbdeef846a98a464bfc102ce282b45e9606.tar.gz
container: fix peekCursor showing hover texts in the wrong order
Diffstat (limited to 'src')
-rw-r--r--src/local/container.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index 70f8964b..384ac6f2 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -226,7 +226,8 @@ proc newContainer*(config: BufferConfig; loaderConfig: LoaderClientConfig;
mainConfig: mainConfig,
flags: flags,
luctx: luctx,
- redraw: true
+ redraw: true,
+ lastPeek: HoverType.high
)
func location(container: Container): URL {.jsfget.} =
@@ -1630,15 +1631,15 @@ proc peek(container: Container) {.jsfunc.} =
container.alert($container.url)
proc clearHover*(container: Container) =
- container.lastPeek = low(HoverType)
+ container.lastPeek = HoverType.high
proc peekCursor(container: Container) {.jsfunc.} =
var p = container.lastPeek
while true:
- if p < high(HoverType):
+ if p < HoverType.high:
inc p
else:
- p = low(HoverType)
+ p = HoverType.low
if container.hoverText[p] != "" or p == container.lastPeek:
break
if container.hoverText[p] != "":