Skip to content

Commit

Permalink
Migrate shortcut selectors for JupyterLab 4.1+ (#135)
Browse files Browse the repository at this point in the history
* Migrate shortcuts to JupyterLab 4.1

* Require JupyterLab 4.1
  • Loading branch information
krassowski authored Feb 7, 2024
1 parent 4832d99 commit 2f1e7b2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
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.0.0,<5"
"jupyterlab>=4.1.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.0.0,<5'",
"python -m pip install 'jupyterlab>=4.1.0,<5'",
"jlpm",
"jlpm build:prod"
]
Expand Down
40 changes: 20 additions & 20 deletions schema/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"command": "notebook:extend-marked-cells-below"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Ctrl Shift J"],
"command": "notebook:extend-marked-cells-below"
},
Expand All @@ -66,7 +66,7 @@
"command": "notebook:extend-marked-cells-above"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Ctrl Shift K"],
"command": "notebook:extend-marked-cells-above"
},
Expand Down Expand Up @@ -116,7 +116,7 @@
"command": "vim:leave-current-mode"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Ctrl I"],
"command": "vim:enter-insert-mode"
},
Expand All @@ -141,7 +141,7 @@
"command": "vim:no-action"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Shift M"],
"command": "vim:merge-and-edit"
},
Expand Down Expand Up @@ -171,82 +171,82 @@
"command": "vim:select-last-cell"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["G", "G"],
"command": "vim:select-first-cell"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Shift G"],
"command": "vim:select-last-cell"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Y", "Y"],
"command": "notebook:copy-cell"
},
{
"command": "notebook:cut-cell",
"keys": ["D", "D"],
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus"
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Shift P"],
"command": "notebook:paste-cell-above"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["P"],
"command": "notebook:paste-cell-below"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["O"],
"command": "notebook:insert-cell-below"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Shift O"],
"command": "notebook:insert-cell-above"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["U"],
"command": "notebook:undo-cell-action"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Ctrl E"],
"command": "notebook:move-cell-down"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Ctrl Y"],
"command": "notebook:move-cell-up"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Z", "Z"],
"command": "vim:center-cell"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Z", "C"],
"command": "notebook:hide-cell-code"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Z", "O"],
"command": "notebook:show-cell-code"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Z", "M"],
"command": "notebook:hide-all-cell-code"
},
{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook:focus",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",
"keys": ["Z", "R"],
"command": "notebook:show-all-cell-code"
},
Expand Down

0 comments on commit 2f1e7b2

Please sign in to comment.