Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ fn settings(root_path: &str, suffix: &str) -> String {
("go-to-only-result", "Directly go to item in search if there is only one result",
false),
("line-numbers", "Show line numbers on code examples", false),
("disable-shortcuts", "Disable keyboard shortcuts", false),
];
format!(
"<h1 class='fqn'>\
Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function getSearchElement() {
"derive",
"traitalias"];

var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") !== "true";
var search_input = getSearchInput();

// On the search screen, so you remain on the last tab you opened.
Expand Down Expand Up @@ -294,7 +295,7 @@ function getSearchElement() {

function handleShortcut(ev) {
// Don't interfere with browser shortcuts
if (ev.ctrlKey || ev.altKey || ev.metaKey) {
if (ev.ctrlKey || ev.altKey || ev.metaKey || disableShortcuts === true) {
return;
}

Expand Down