Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codemirror-vim to 6.2.1 and jupyterlab to 4.2.0 #146

Merged
merged 8 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@
"style/index.js"
],
"dependencies": {
"@codemirror/state": "^6.2.1",
"@codemirror/view": "^6.15.3",
"@jupyterlab/application": "^4.0.3",
"@jupyterlab/cells": "^4.0.3",
"@jupyterlab/codemirror": "^4.0.3",
"@jupyterlab/fileeditor": "^4.0.3",
"@jupyterlab/notebook": "^4.0.3",
"@jupyterlab/settingregistry": "^4.0.3",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.26.0",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/cells": "^4.2.0",
"@jupyterlab/codemirror": "^4.2.0",
"@jupyterlab/fileeditor": "^4.2.0",
"@jupyterlab/notebook": "^4.2.0",
"@jupyterlab/settingregistry": "^4.2.0",
"@lumino/commands": "^2.0.1",
"@lumino/coreutils": "^2.0.0",
"@lumino/disposable": "^2.1.2",
"@replit/codemirror-vim": "^6.0.14",
"@replit/codemirror-vim": "^6.2.1",
"react": "^18.2.0"
},
"devDependencies": {
"@codemirror/language": "^6.8.0",
"@codemirror/search": "^6.5.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/codeeditor": "^4.0.3",
"@codemirror/language": "^6.10.1",
"@codemirror/search": "^6.5.6",
"@jupyterlab/builder": "^4.2.0",
"@jupyterlab/codeeditor": "^4.2.0",
"@types/codemirror": "^0.0.87",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"jupyterlab>=4.1.0,<5"
"jupyterlab>=4.2.0,<5"
]
dynamic = ["version", "description", "authors", "urls", "keywords"]

Expand Down Expand Up @@ -67,7 +67,7 @@ version_cmd = "hatch version"

[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.1.0,<5'",
"python -m pip install 'jupyterlab>=4.2.0,<5'",
"jlpm",
"jlpm build:prod"
]
Expand Down
4 changes: 4 additions & 0 deletions src/codemirrorCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +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) {
throw Error('CodeMirror vim state not available');
return;
}
editor.host.dataset.jpVimModeName = cm.state.vim.mode;
});
mirrorEditor.hasFocus = () => {
Expand Down
4 changes: 4 additions & 0 deletions src/labCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ export function addNotebookCommands(
return;
}
const vim = cm.state.vim;
if (!vim) {
console.error('CodeMirror vim state not found');
return;
}

// Get the current editor state
if (
Expand Down
Loading
Loading