Ameliorate #454: allow historyresults to be configured

This commit is contained in:
Oliver Blanthorn 2018-05-03 17:48:03 +01:00
parent 7e55762940
commit 4a8870c363
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 8 additions and 1 deletions

View file

@ -12,6 +12,7 @@ import * as Fuse from "fuse.js"
import { enumerate } from "./itertools"
import { toNumber } from "./convert"
import * as Messaging from "./messaging"
import * as config from "./config"
import { browserBg } from "./lib/webext"
const DEFAULT_FAVICON = browser.extension.getURL("static/defaultFavicon.svg")
@ -500,7 +501,7 @@ export class HistoryCompletionSource extends CompletionSourceFuse {
// Search history, dedupe and sort by frecency
let history = await browserBg.history.search({
text: query,
maxResults: 500,
maxResults: Number(config.get("historyresults")),
startTime: 0,
})

View file

@ -247,6 +247,11 @@ const DEFAULTS = o({
browser: "firefox",
nativeinstallcmd:
"curl -fsSl https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/install.sh | bash",
// Performance related settings
// number of most recent results to ask Firefox for. We display the top 20 or so most frequently visited ones.
historyresults: "50",
})
/** Given an object and a target, extract the target if it exists, else return undefined

View file

@ -527,6 +527,7 @@ export async function reloadhard(n = 1) {
Related settings:
"searchengine": "google" or any of [[SEARCH_URLS]]
"historyresults": the n-most-recent results to ask Firefox for before they are sorted by frequency. Reduce this number if you find your results are bad.
*/
//#content
export async function open(...urlarr: string[]) {