Skip to content

Commit

Permalink
Null-check call result rather than function itself
Browse files Browse the repository at this point in the history
From the comment, it seems like this was supposed check for chords, rather than checking for the availability of `isChord`.

Co-authored-by: Paul Maréchal <paul.marechal@ericsson.com>
Signed-off-by: Andrew Casey <andrew.casey@microsoft.com>
  • Loading branch information
amcasey and paul-marechal committed Apr 1, 2020
1 parent 500432b commit 7f9f2a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions examples/api-tests/src/monaco-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ describe('Monaco API', async function () {
}, {
label: 'Ctrl+Shift+Alt+K',
ariaLabel: 'Ctrl+Shift+Alt+K',
// eslint-disable-next-line no-null/no-null
electronAccelerator: null,
electronAccelerator: 'Ctrl+Shift+Alt+K',
userSettingsLabel: 'ctrl+shift+alt+K',
WYSIWYG: true,
chord: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco/src/browser/monaco-resolved-keybinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class MonacoResolvedKeybinding extends monaco.keybindings.ResolvedKeybind
}

public getElectronAccelerator(): string | null {
if (this.isChord) {
if (this.isChord()) {
// Electron cannot handle chords
// eslint-disable-next-line no-null/no-null
return null;
Expand Down

0 comments on commit 7f9f2a4

Please sign in to comment.