Skip to content

Commit 1ca1457

Browse files
authored
Support type '/' to search
1 parent 6bbd8c5 commit 1ca1457

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/librustdoc/html/static/js/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ function preLoadCss(cssUrl) {
438438

439439
case "s":
440440
case "S":
441+
case "/":
441442
ev.preventDefault();
442443
searchState.focus();
443444
break;
@@ -1310,7 +1311,7 @@ function preLoadCss(cssUrl) {
13101311

13111312
const shortcuts = [
13121313
["?", "Show this help dialog"],
1313-
["S", "Focus the search field"],
1314+
["S / /", "Focus the search field"],
13141315
["↑", "Move up in search results"],
13151316
["↓", "Move down in search results"],
13161317
["← / →", "Switch result tab (when results focused)"],

src/librustdoc/html/templates/page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ <h2>Files</h2> {# #}
135135
aria-label="Run search in the documentation" {#+ #}
136136
autocomplete="off" {#+ #}
137137
spellcheck="false" {#+ #}
138-
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {#+ #}
138+
placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" {#+ #}
139139
type="search"> {# #}
140140
<div id="help-button" tabindex="-1"> {# #}
141141
<a href="{{page.root_path|safe}}help.html" title="help">?</a> {# #}

0 commit comments

Comments
 (0)