Repository navigation
Feat: select, reveal and fold on the code editor handle (FR-38) - #173
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CodeEditorHandlecouldeditthe document but not move the reader's selection, scroll to a range or fold a stretch, althoughBatchalready writesSetSelection,RevealRangeandSetFolded. 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)andhandle.fold(start_line, collapsed), queued likeeditand 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}wrapBatch::{set_selection, reveal_range, set_folded}.Tests (FR-38)
fr38_select_reveal_and_fold_asked_of_a_handle_go_out_to_its_editor: oneSetSelection/RevealRange/SetFoldedrecord each, addressed to the editor, with the version they were written against.fr38_requests_of_a_handle_no_editor_carries_are_dropped.code_editor8,rsx_surface, lib tests pass;cargo fmtclean; 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.