jupyterlab icon indicating copy to clipboard operation
jupyterlab copied to clipboard

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

Open krassowski opened this issue 1 year ago • 1 comments
trafficstars

References

Closes #16196

Code changes

  • [x] update @codemirror/commands
  • [x] 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 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

krassowski avatar Apr 26 '24 13:04 krassowski

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

jupyterlab-probot[bot] avatar Apr 26 '24 13:04 jupyterlab-probot[bot]

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

krassowski avatar May 08 '24 09:05 krassowski