Skip to content

Commit cb7c912

Browse files
committed
autodoc: use location.replace to avoid history spam when searching
1 parent 9fc6990 commit cb7c912

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/docs/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,8 +3264,7 @@ var zigAnalysis;
32643264
let oldHash = location.hash;
32653265
let parts = oldHash.split("?");
32663266
let newPart2 = domSearch.value === "" ? "" : "?" + domSearch.value;
3267-
location.hash =
3268-
parts.length === 1 ? oldHash + newPart2 : parts[0] + newPart2;
3267+
location.replace(parts.length === 1 ? oldHash + newPart2 : parts[0] + newPart2);
32693268
}
32703269
function getSearchTerms() {
32713270
let list = curNavSearch.trim().split(/[ \r\n\t]+/);

0 commit comments

Comments
 (0)