Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
firai committed Sep 9, 2024
1 parent 512a64d commit ffb05b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/codemirrorCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ export class VimEditorManager {
// we override `hasFocus` handler to ensure it is taken into account.
const cm = getCM(view)!;
cm.on('vim-mode-change', () => {
if (!cm.state.vim) return;
if (!cm.state.vim) {
throw Error('CodeMirror vim state not available');
return;
}
editor.host.dataset.jpVimModeName = cm.state.vim.mode;
});
mirrorEditor.hasFocus = () => {
Expand Down
5 changes: 4 additions & 1 deletion src/labCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ export function addNotebookCommands(
return;
}
const vim = cm.state.vim;
if (!vim) return;
if (!vim) {
console.error('CodeMirror vim state not found');
return;
}

// Get the current editor state
if (
Expand Down

0 comments on commit ffb05b1

Please sign in to comment.