Skip to content

Feat: select, reveal and fold on the code editor handle (FR-38) - #173

Merged
b-re-w merged 1 commit into
developfrom
feat/code-editor-handle-select
Nov 6, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/code-editor-handle-select

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 6, 2026

Copy link
Copy Markdown
Member

CodeEditorHandle could edit the document but not move the reader's selection, scroll to a range or fold a stretch, although Batch already writes SetSelection, RevealRange and SetFolded. Needed by the Ember editor's find and replace (go to a match) and by the problems list (go to a line).

What

  • handle.select(base_version, anchor, active), handle.reveal(base_version, range, align) and handle.fold(start_line, collapsed), queued like edit and written to the editor node that carries the handle, in the batch of the call that asked, after the tree (an editor created in the same call exists when its first request arrives). A handle no editor carries drops its requests before the boundary.
  • hooks::EditorRequest (Edit, Select, Reveal, Fold) replaces the edit-only queue; Renderer::{select_code, reveal_code, fold_code} wrap Batch::{set_selection, reveal_range, set_folded}.

Tests (FR-38)

  • fr38_select_reveal_and_fold_asked_of_a_handle_go_out_to_its_editor: one SetSelection / RevealRange / SetFolded record each, addressed to the editor, with the version they were written against.
  • fr38_requests_of_a_handle_no_editor_carries_are_dropped.
  • Run: code_editor 8, rsx_surface, lib tests pass; cargo fmt clean; clippy shows only the existing blitz-dom warnings.

Not in this PR

No on-screen check: the requests are the existing ones the renderer already handles; the Ember editor's use of them (find and replace) comes next and is checked there.

An application could edit the text a CodeEditor holds through its handle but could not move the
reader's selection, scroll to a range or fold a stretch, although the Batch writes those requests.
CodeEditorHandle gains select, reveal and fold, queued like edit and written to the editor that carries
the handle in the batch of the call that asked; a handle no editor carries drops them. Tested through
the fake renderer.
@b-re-w
b-re-w merged commit c395777 into develop Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant