mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Add abnormal binds to help page
That was about 1000x easier than I was expecting. Thanks @glacambre!
This commit is contained in:
parent
756c29673a
commit
e0f9fa4e45
2 changed files with 22 additions and 9 deletions
|
@ -31,6 +31,14 @@
|
|||
|
||||
A "splat" operator (...) means that the excmd will accept any number of space-delimited arguments into that parameter.
|
||||
|
||||
Above each function signature you will see any aliases or key sequences bound to it. The internal names for the various modes are used, which are listed here:
|
||||
|
||||
- `nmaps`: normal mode binds
|
||||
- `imaps`: insert mode binds
|
||||
- `inputmaps`: input mode binds
|
||||
- `ignoremaps`: ignore mode binds
|
||||
- `exaliases`: aliases in the command mode
|
||||
|
||||
You do not need to worry about types. Return values which are promises will turn into whatever they promise to when used in [[composite]].
|
||||
|
||||
At the bottom of each function's help page, you can click on a link that will take you straight to that function's definition in our code. This is especially recommended for browsing the [config](/static/docs/modules/_src_config_.html#defaults) which is nigh-on unreadable on these pages.
|
||||
|
|
23
src/help.ts
23
src/help.ts
|
@ -88,19 +88,24 @@ async function addSetting(settingName: string) {
|
|||
browser.storage.onChanged.addListener((changes, areaname) => {
|
||||
if ("userconfig" in changes) {
|
||||
// JSON.stringify for comparisons like it's 2012
|
||||
;["exaliases", "nmaps"].forEach(kind => {
|
||||
if (
|
||||
JSON.stringify(changes.userconfig.newValue[kind]) !=
|
||||
JSON.stringify(changes.userconfig.oldValue[kind])
|
||||
)
|
||||
addSetting(kind)
|
||||
})
|
||||
;["nmaps", "imaps", "ignoremaps", "inputmaps", "exaliases"].forEach(
|
||||
kind => {
|
||||
if (
|
||||
JSON.stringify(changes.userconfig.newValue[kind]) !=
|
||||
JSON.stringify(changes.userconfig.oldValue[kind])
|
||||
)
|
||||
addSetting(kind)
|
||||
},
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
addEventListener("load", async () => {
|
||||
await addSetting("exaliases")
|
||||
await addSetting("nmaps")
|
||||
await Promise.all(
|
||||
["nmaps", "imaps", "ignoremaps", "inputmaps", "exaliases"].map(
|
||||
addSetting,
|
||||
),
|
||||
)
|
||||
// setCommandSetting() can change the height of nodes in the page so we need to scroll to the right place again
|
||||
if (document.location.hash) {
|
||||
document.location.hash = document.location.hash
|
||||
|
|
Loading…
Add table
Reference in a new issue