repl: Incorporate moving down to next cell in jupytext mode (#15094)

`jupytext_snippets` now returns back both the jupytext snippets and the
`Point` of the next jupytext snippet.

Release Notes:

- N/A
This commit is contained in:
Kyle Kelley 2024-07-24 08:53:10 -07:00 committed by GitHub
parent 9e528dbb16
commit 0843da0f81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 18 deletions

View file

@ -381,6 +381,7 @@ impl Session {
&mut self,
code: String,
anchor_range: Range<Anchor>,
next_cell: Option<Anchor>,
cx: &mut ViewContext<Self>,
) {
let Some(editor) = self.editor.upgrade() else {
@ -453,7 +454,11 @@ impl Session {
return;
};
let new_cursor_pos = editor_block.invalidation_anchor;
let new_cursor_pos = if let Some(next_cursor) = next_cell {
next_cursor
} else {
editor_block.invalidation_anchor
};
self.blocks
.insert(message.header.msg_id.clone(), editor_block);