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

Add an option to continue indentation, upgrade @codemirror/commands #16252

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krassowski
Copy link
Member

References

Closes #16196

Code changes

  • update @codemirror/commands
  • add an option to continue indentation
  • add a test

User-facing changes

New continue indentation option:

image

TBD, as the current behaviour of insertNewlineKeepIndent turned out to be different from what I thought it would do, see codemirror/dev#1370 (comment).

Depending on whether upstream (CodeMirror) reconsiders, we may need to do something different, for example always run insertNewlineAndIndent while comparing the indentation before and after and if it decreased at the end of the block we would re-add the indentation. Or maybe we need to vendor a modified copy of insertNewlineAndIndent which does not dedent at the end of the block (not sure if this is feasible). Or maybe we need to modify the Python language implementation only in which case this PR would be of little use in the current state.

Backwards-incompatible changes

None

@krassowski krassowski added this to the 4.3.0 milestone Apr 26, 2024
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Python indented structures in JupyterLab
1 participant