From 6e13f240f748b224ab21aee674a75bafcb5326ab Mon Sep 17 00:00:00 2001 From: ArtificialSloth Date: Wed, 8 Apr 2026 11:10:47 -0400 Subject: [PATCH] Add draw options for search matches (#122) --- view.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/view.js b/view.js index 23d8357..7397ea2 100644 --- a/view.js +++ b/view.js @@ -216,6 +216,8 @@ export class View extends HTMLElement { #tocProgress #pageProgress #searchResults = new Map() + #searchDraw + #searchDrawOptions #cursorAutohider = new CursorAutohider(this, () => this.hasAttribute('autohide-cursor')) isFixedLayout = false @@ -376,7 +378,7 @@ export class View extends HTMLElement { return } const range = doc ? anchor(doc) : anchor - overlayer.add(value, range, Overlayer.outline) + overlayer.add(value, range, this.#searchDraw, this.#searchDrawOptions) } return } @@ -539,6 +541,8 @@ export class View extends HTMLElement { } async * search(opts) { this.clearSearch() + this.#searchDraw = opts.draw ?? Overlayer.outline + this.#searchDrawOptions = opts.drawOptions const { searchMatcher } = await import('./search.js') const { query, index } = opts const matcher = searchMatcher(textWalker,