Skip to content

Commit 329a585

Browse files
authored
Merge pull request #15512 from cryptocode/autodoc-searchkey
autodoc: Add / as an alternative search key
2 parents 729a051 + 216ef10 commit 329a585

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ <h2><span>Zig Version</span></h2>
758758
<div class="wrap">
759759
<section class="docs" style="padding-top: 1.5rem; padding-bottom:0;">
760760
<div style="position: relative">
761-
<span id="searchPlaceholder"><kbd>s</kbd> to search, <kbd>?</kbd> for more options</span>
761+
<span id="searchPlaceholder"><kbd>/</kbd> or <kbd>s</kbd> to search, <kbd>?</kbd> for more options</span>
762762
<input type="search" class="search" id="search" autocomplete="off" spellcheck="false" disabled>
763763
</div>
764764
</section>
@@ -876,7 +876,7 @@ <h2>Tests</h2>
876876
<div class="modal">
877877
<h1>Keyboard Shortcuts</h1>
878878
<dl><dt><kbd>?</kbd></dt><dd>Toggle this help modal</dd></dl>
879-
<dl><dt><kbd>s</kbd></dt><dd>Focus the search field</dd></dl>
879+
<dl><dt><kbd>s</kbd> or <kbd>/</kbd></dt><dd>Focus the search field</dd></dl>
880880
<div style="margin-left: 1em">
881881
<dl><dt><kbd></kbd></dt><dd>Move up in search results</dd></dl>
882882
<dl><dt><kbd></kbd></dt><dd>Move down in search results</dd></dl>

lib/docs/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4106,6 +4106,7 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) {
41064106
case "Esc":
41074107
onEscape(ev);
41084108
break;
4109+
case "/":
41094110
case "s":
41104111
if (domHelpModal.classList.contains("hidden")) {
41114112
if (ev.target == domSearch) break;

0 commit comments

Comments
 (0)