Make bookmark name configurable and change completion title

This commit is contained in:
Oliver Blanthorn 2019-07-15 10:29:36 +01:00
parent 277de2314b
commit cad52abee9
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 7 additions and 2 deletions

View file

@ -35,7 +35,7 @@ export class HistoryCompletionSource extends Completions.CompletionSourceFuse {
super(
["open", "tabopen", "winopen"],
"HistoryCompletionSource",
"History",
"History and bookmarks",
)
this._parent.appendChild(this.node)

View file

@ -93,7 +93,7 @@ export async function getCombinedHistoryBmarks(query: string): Promise<Array<{ti
else combinedMap.set(page.url, {title: page.title, url: page.url, history: page})
})
const score = x => (x.history ? frecency(x.history) : 0) - (x.bmark ? 1000 : 0)
const score = x => (x.history ? frecency(x.history) : 0) - (x.bmark ? config.get("bmarkweight") : 0)
return Array.from(combinedMap.values()).sort((a, b) => score(a) - score(b))
}

View file

@ -861,6 +861,11 @@ export class default_config {
*/
historyresults = 50
/**
* When displaying bookmarks in history completions, how many page views to pretend they have.
*/
bmarkweight = 100
/**
* Number of results that should be shown in completions. -1 for unlimited
*/