From fd2b71b610baf7164dd06046f9bd8b4feec93e64 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Wed, 30 Jul 2025 10:30:58 -0700 Subject: [PATCH] autoscroll: don't log same debug message multiple times --- src/autoscroll.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/autoscroll.ts b/src/autoscroll.ts index d68d9eb..7a05fc6 100644 --- a/src/autoscroll.ts +++ b/src/autoscroll.ts @@ -12,6 +12,7 @@ export class AutoScroll extends Behavior { samePosCount: number; origPath: string; + lastMsg = ""; constructor(autofetcher: AutoFetcher) { super(); @@ -37,6 +38,14 @@ export class AutoScroll extends Behavior { return this.currScrollPos() < Math.max(scrollElem.clientHeight, scrollElem.scrollHeight); } + debug(msg: string) { + if (this.lastMsg === msg) { + return; + } + super.debug(msg); + this.lastMsg = msg; + } + hasScrollEL(obj) { try { return !!self["getEventListeners"](obj).scroll;