motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 329a585fbe50583d6cef7a554c27525afe2e9d41 (tree)
parent 729a051e9e38674233190aea23c0ac8c134f2d67
Author: Loris Cro <kappaloris@gmail.com>
Date:   Sun, 18 Jun 2023 09:06:51 +0200

Merge pull request #15512 from cryptocode/autodoc-searchkey

autodoc: Add / as an alternative search key
Diffstat:
Mlib/docs/index.html | 4++--
Mlib/docs/main.js | 1+
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/docs/index.html b/lib/docs/index.html @@ -758,7 +758,7 @@ <div class="wrap"> <section class="docs" style="padding-top: 1.5rem; padding-bottom:0;"> <div style="position: relative"> - <span id="searchPlaceholder"><kbd>s</kbd> to search, <kbd>?</kbd> for more options</span> + <span id="searchPlaceholder"><kbd>/</kbd> or <kbd>s</kbd> to search, <kbd>?</kbd> for more options</span> <input type="search" class="search" id="search" autocomplete="off" spellcheck="false" disabled> </div> </section> @@ -876,7 +876,7 @@ <div class="modal"> <h1>Keyboard Shortcuts</h1> <dl><dt><kbd>?</kbd></dt><dd>Toggle this help modal</dd></dl> - <dl><dt><kbd>s</kbd></dt><dd>Focus the search field</dd></dl> + <dl><dt><kbd>s</kbd> or <kbd>/</kbd></dt><dd>Focus the search field</dd></dl> <div style="margin-left: 1em"> <dl><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd></dl> <dl><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd></dl> diff --git a/lib/docs/main.js b/lib/docs/main.js @@ -4106,6 +4106,7 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) { case "Esc": onEscape(ev); break; + case "/": case "s": if (domHelpModal.classList.contains("hidden")) { if (ev.target == domSearch) break;