-
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
Don't render Markdown when attempting to navigate above first cell #119
Don't render Markdown when attempting to navigate above first cell #119
Conversation
This PR currently makes The disadvantage of doing this is that we still don't have a way to identify the last cell, which we may want for future special last cell handling (say, if we wanted to auto-return to vim mode after coming back up from the footer after jupyterlab/jupyterlab#14796, or block vim mode from going to the footer altogether). I'm not sure if there are any needs for having the numerical cell index. In lieu of passing the numerical cell index, it would be possible to make the caller pass a string or enum to identify first and last cells, with the calling function handling the identification. A dummy/other value would most likely be passed for any other cell location in these cases. It would also be possible to have both if we make the calling function change the passed cell index to -1 for the last cell, but that's, well, hacky. |
This is correct.
(this can be taken from
Edge case: console. In console mode there is one cell that can be focused, the input cell at the bottom. There are cells above it which cannot be navigated to. Does it make the input cell the first and the last cell? While console is not currently vim enabled (I think?), it could be in the future. I think the most future proof approach would be to make
interface ICellContext {
index?: number;
cellCount?: number; // or `total`
// in the future, if needed, we could add:
// type: 'notebook' | 'console'
} What do you think? |
Thanks for the suggestion, @krassowski! After attempting to implementing this, P.s. I tried console logging the state of Completely scratching my head on this one, and I'm starting to think this might be related to #15 (comment) (but reverse).
EDIT: Consolidated my investigations on the bug that I thought was caused by the latest commit, but now does not appear to be. The bug discussed in the collapsed sections, where I think we should be otherwise good to go, pending code review. |
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.
Thank you @firai, tested locally to confirm that this fixes the issue.
Fixes #52. Disable Markdown rendering when the following keys are pressed in the first cell (if it is a Markdown cell), in order to keep CM focused: