diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-16 17:54:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-16 17:54:40 +0200 |
| commit | 49f6c95ba38c12208db95a7558fb5909341cd262 (patch) | |
| tree | 4aa50809e68e02779388b0d3cb05656589bec930 | |
| parent | 592b1ca99a0a87c780bc0d4c2ef7ff8b8c6e9715 (diff) | |
| parent | 1ca145778a4971d82c56025ece1824ec672428b9 (diff) | |
| download | rust-49f6c95ba38c12208db95a7558fb5909341cd262.tar.gz rust-49f6c95ba38c12208db95a7558fb5909341cd262.zip | |
Rollup merge of #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
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/templates/page.html | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 940b62be0c9..ee7d19634b4 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -462,6 +462,7 @@ function preLoadCss(cssUrl) { case "s": case "S": + case "/": ev.preventDefault(); searchState.focus(); break; @@ -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)"], diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 1dc9041658e..1e01cd70b96 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -129,7 +129,7 @@ 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> {# #} |
