diff --git a/js/search.js b/js/search.js index e67506f8a..c8b5ec151 100644 --- a/js/search.js +++ b/js/search.js @@ -61,6 +61,8 @@ var bufs = ['','','','']; var topbufIndex = -1; + var nearMatch = (BattleSearchIndex[i].substr(0,query.length) !== query); + if (nearMatch && i) i--; for (var j=0; j<15; j++) { var id = BattleSearchIndex[i+j]; var type = BattleSearchIndexType[i+j]; @@ -68,7 +70,7 @@ if (!id) break; if (id.substr(0,query.length) !== query) { - if (j) break; + if (!(nearMatch && j<=1)) break; matchLength = 0; } if (j === 0 && this.exactMatch) { @@ -76,7 +78,6 @@ } if (!bufs[typeTable[type]]) bufs[typeTable[type]] = '