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.
References
Closes #16196
Code changes
@codemirror/commands
User-facing changes
New continue indentation option:
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 ofinsertNewlineAndIndent
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