mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 10:01:39 -05:00
Make platform-specific defaults more extensible
This commit is contained in:
parent
50e6c25913
commit
b6eec7405b
1 changed files with 21 additions and 19 deletions
|
@ -1060,24 +1060,26 @@ export class default_config {
|
||||||
visualexitauto: "true" | "false" = "true"
|
visualexitauto: "true" | "false" = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
const windows_defaults = {
|
const platform_defaults = {
|
||||||
browsermaps: {
|
win: {
|
||||||
"<C-6>": null,
|
browsermaps: {
|
||||||
"<A-6>": "buffer #",
|
"<C-6>": null,
|
||||||
} as unknown, // typescript doesn't like me adding new binds like this
|
"<A-6>": "buffer #",
|
||||||
nmaps: {
|
} as unknown, // typescript doesn't like me adding new binds like this
|
||||||
"<C-6>": "buffer #",
|
nmaps: {
|
||||||
} as unknown,
|
"<C-6>": "buffer #",
|
||||||
imaps: {
|
} as unknown,
|
||||||
"<C-6>": "buffer #",
|
imaps: {
|
||||||
} as unknown,
|
"<C-6>": "buffer #",
|
||||||
inputmaps: {
|
} as unknown,
|
||||||
"<C-6>": "buffer #",
|
inputmaps: {
|
||||||
} as unknown,
|
"<C-6>": "buffer #",
|
||||||
ignoremaps: {
|
} as unknown,
|
||||||
"<C-6>": "buffer #",
|
ignoremaps: {
|
||||||
} as unknown,
|
"<C-6>": "buffer #",
|
||||||
} as default_config
|
} as unknown,
|
||||||
|
},
|
||||||
|
} as Record<browser.runtime.PlatformOs, default_config>
|
||||||
|
|
||||||
|
|
||||||
/** @hidden
|
/** @hidden
|
||||||
|
@ -1086,7 +1088,7 @@ const windows_defaults = {
|
||||||
export const mergeDeepCull = R.pipe(mergeDeep, removeNull)
|
export const mergeDeepCull = R.pipe(mergeDeep, removeNull)
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
export const DEFAULTS = platform.getPlatformOs() == "win" ? mergeDeepCull(o(new default_config()), windows_defaults) : o(new default_config())
|
export const DEFAULTS = mergeDeepCull(o(new default_config()), platform_defaults[platform.getPlatformOs()])
|
||||||
|
|
||||||
/** Given an object and a target, extract the target if it exists, else return undefined
|
/** Given an object and a target, extract the target if it exists, else return undefined
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue