From ffb05b15fddfb18c202826b9e87d60a2f1f938a4 Mon Sep 17 00:00:00 2001 From: firai Date: Mon, 9 Sep 2024 14:55:46 +0000 Subject: [PATCH] Fix lint --- src/codemirrorCommands.ts | 5 ++++- src/labCommands.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/codemirrorCommands.ts b/src/codemirrorCommands.ts index 6a1790d..9f88404 100644 --- a/src/codemirrorCommands.ts +++ b/src/codemirrorCommands.ts @@ -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 = () => { diff --git a/src/labCommands.ts b/src/labCommands.ts index 34a70ce..10ea32a 100644 --- a/src/labCommands.ts +++ b/src/labCommands.ts @@ -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 (