mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
feat: add hintnames reverse option for shuffled hints
This commit is contained in:
parent
e771471e8e
commit
684bd2446a
|
|
@ -762,6 +762,14 @@ function* hintnames_words(n: number): IterableIterator<string> {
|
|||
)
|
||||
}
|
||||
|
||||
/** Reversed lexicographic hintnames.
|
||||
* Reverses each hint so that nearby DOM elements get different first characters,
|
||||
* making typed filtering more effective. See #3880.
|
||||
* @hidden */
|
||||
function* hintnames_reverse(n: number, hintchars = defaultHintChars()): IterableIterator<string> {
|
||||
yield* map(hintnames_uniform(n, hintchars), hint => hint.split("").reverse().join(""))
|
||||
}
|
||||
|
||||
/** @hidden */
|
||||
function* hintnames(
|
||||
n: number,
|
||||
|
|
@ -774,6 +782,8 @@ function* hintnames(
|
|||
yield* hintnames_uniform(n, hintchars)
|
||||
case "words":
|
||||
yield* hintnames_words(n)
|
||||
case "reverse":
|
||||
yield* hintnames_reverse(n, hintchars)
|
||||
default:
|
||||
yield* hintnames_short(n, hintchars)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -897,9 +897,9 @@ export class default_config {
|
|||
hintfiltermode: "simple" | "vimperator" | "vimperator-reflow" = "simple"
|
||||
|
||||
/**
|
||||
* Whether to optimise for the shortest possible names for each hint, or to use a simple numerical ordering. If set to `numeric` or `words`, overrides `hintchars` setting. `words` uses random three letter English words (and therefore works badly with hintfiltermode vimperator*)
|
||||
* Whether to optimise for the shortest possible names for each hint, or to use a simple numerical ordering. If set to `numeric` or `words`, overrides `hintchars` setting. `words` uses random three letter English words (and therefore works badly with hintfiltermode vimperator*). `reverse` reverses each hint so nearby elements get different first characters.
|
||||
*/
|
||||
hintnames: "short" | "numeric" | "uniform" | "words" = "short"
|
||||
hintnames: "short" | "numeric" | "uniform" | "words" | "reverse" = "short"
|
||||
|
||||
/**
|
||||
* Whether to display the names for hints in uppercase.
|
||||
|
|
|
|||
Loading…
Reference in a new issue