jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
13.82k stars 3.12k forks source link

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

Closed krassowski closed 6 days ago

krassowski commented 2 weeks ago

References

Closes #16196

Code changes

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 https://github.com/codemirror/dev/issues/1370#issuecomment-2079392856.

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

jupyterlab-probot[bot] commented 2 weeks ago

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

krassowski commented 6 days ago

Closing in favour of https://github.com/jupyterlab/jupyterlab/pull/16306