Skip to content

Commit

Permalink
Unrolled build for rust-lang#123355
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#123355 - mu001999:rustdoc/search, r=GuillaumeGomez

Support type '/' to search

Related topic on IRLO: https://internals.rust-lang.org/t/rustdoc-use-key-to-search-instead-of-s/20559
  • Loading branch information
rust-timer authored Apr 16, 2024
2 parents 1dea922 + 1ca1457 commit 6297a30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ function preLoadCss(cssUrl) {

case "s":
case "S":
case "/":
ev.preventDefault();
searchState.focus();
break;
Expand Down Expand Up @@ -1334,7 +1335,7 @@ function preLoadCss(cssUrl) {

const shortcuts = [
["?", "Show this help dialog"],
["S", "Focus the search field"],
["S / /", "Focus the search field"],
["↑", "Move up in search results"],
["↓", "Move down in search results"],
["← / →", "Switch result tab (when results focused)"],
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h2>Files</h2> {# #}
aria-label="Run search in the documentation" {#+ #}
autocomplete="off" {#+ #}
spellcheck="false" {#+ #}
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {#+ #}
placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" {#+ #}
type="search"> {# #}
<div id="help-button" tabindex="-1"> {# #}
<a href="{{page.root_path|safe}}help.html" title="help">?</a> {# #}
Expand Down

0 comments on commit 6297a30

Please sign in to comment.