-
Notifications
You must be signed in to change notification settings - Fork 44
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
Settings for enable/disable #32
Conversation
Hi @mlucool thanks for doing this! (also nice to see you here). Overall I'm 👍 to this and thanks for taking initiative to clean up the structure a bit. What do you think of adding an on/off toggle to the |
Also I think if you add |
Fair enough. Although, fair warning I was one of the drivers of the "built into lab" and I haven't/won't have time for that for awhile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a clear step in the right direction but I think that we shouldn't merge this until we add code to clean up after ourselves when a user disables vim mode. There are currently two issues:
- Cells that the user has already entered will remain in vim mode
- All of our commands will remain. So the user won't get back the behavior of
Esc
taking them to the notebook command mode.
I think the fixes for both of these problems can be found in my (now stalled) PR adding vim support to core: jupyterlab/jupyterlab#9068 please feel free to extract them into this PR.
When the settings flip us from enabled
to disabled
we need to
- Use the notebook tracker to loop over all existing cells and ensure that they are no longer in vim mode
- Save the return statements from when we assign the commands and then call the lumino
dispose
method on them to get rid of them
Expanding a little bit more. For 1: For 2: |
Thanks for the feedback @ianhi. Would you be able to pull those changes on top of this or would you like me to? |
I can do this at some point but can't guarantee any timeline as Jlab-vim is mostly a weekends only thing for me right now. (There are just too many interesting things in the world to learn about and to do 😞 ) |
Setup.py was forcing a rebuild of the JS on install. This used python -m jupyterlab.upgrade_extension . to regerate this to the latest version which fixes that issue
Would it be possible to merge this without the "clean disable" flow above as long as the toggle is buried in the settings menu? I totally agree with @ianhi that a proper cleanup should be done if the setting is exposed as a drop-down in the UI, but a stopgap that requires changing the json settings document then refreshing page seems reasonable-ish in the time being? |
That's a good idea. Prioritize the good over the perfect. I think we should add a comment to the settings file mentioning the need to refresh, but otherwise 👍 from me. |
oh I see that's already been done! I'll look into actually merging this tonight or tomorrow |
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@axlair/jupyterlab_vim", | |||
"version": "0.13.4", | |||
"version": "0.13.5-rc.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of adding rc.2
? Won't that make it so that pip install
doesn't pick up this version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove that. I accidently left that during my test of publishing this to an internal registry
Anything still holding up the merge? |
Apparently only my medium term memory. Sorry about that! |
I'm giving the binder one final test to be sure - but merging and subsequent automated release should be imminent |
Thanks @mlucool ! |
pypi publish action here: https://github.com/axelfahy/jupyterlab-vim/actions/runs/797794893 |
ack! it failed due to the same error as jupyter-widgets/widget-ts-cookiecutter#101 |
I ended up needing to do that change a few times already today (which felt very silly to be forced into, although clearly an improvement in code), so one more was somewhat fast: #34 |
Fixes #24
Please finish the following when submitting a pull request:
History.md
briefly documenting the change.If this is a release, additionally do the following:
package.json
jlpm install
to updateyarn.lock
Thanks!