mirror of
https://github.com/Silverquark/dance.git
synced 2024-09-11 10:45:43 +03:00
Implicitly convert menu item args to arrays in dance.openMenu (fixes #177).
This commit is contained in:
parent
597be1e3d5
commit
c1b33ba301
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -34,11 +34,4 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
"spellright.language": [
|
||||
"en"
|
||||
],
|
||||
"spellright.documentTypes": [
|
||||
"latex",
|
||||
"plaintext"
|
||||
],
|
||||
}
|
||||
|
@ -159,14 +159,20 @@ export namespace showLockedMenu {
|
||||
function mergeArgs(args: readonly any[] | undefined, additionalArgs: readonly any[]) {
|
||||
if (args == null) {
|
||||
return additionalArgs;
|
||||
} else if (additionalArgs.length > 0) {
|
||||
}
|
||||
|
||||
if (!Array.isArray(args)) {
|
||||
args = [args];
|
||||
}
|
||||
|
||||
if (additionalArgs.length > 0) {
|
||||
return args.length > additionalArgs.length
|
||||
? args.map((arg, i) =>
|
||||
i < additionalArgs.length && additionalArgs[i]
|
||||
? Object.assign({}, additionalArgs[i], arg)
|
||||
: arg)
|
||||
: additionalArgs.map((arg, i) =>
|
||||
i < args.length ? Object.assign({}, arg, args[i]) : arg);
|
||||
i < args!.length ? Object.assign({}, arg, args![i]) : arg);
|
||||
} else {
|
||||
return args;
|
||||
}
|
||||
|
@ -779,6 +779,8 @@ export namespace Recorder {
|
||||
* succeeded or `false` if the current record is the first one available.
|
||||
*/
|
||||
public previous(): this is Cursor<Entry.Any> {
|
||||
assert(this._offset >= 0);
|
||||
|
||||
if (this._offset === 0) {
|
||||
if (this._bufferIdx === 0) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user