Conversation
Collaborator
Author
|
This is nearly ready, I've discovered some odd behavior when using the minimap in CodeEdit. I'm going to mark this as a draft again until I can resolve those. |
Collaborator
|
Looks amazing! Can you also provide a screen recording of scrolling through a long file? Also, does the position update when opening the find panel? |
Collaborator
Author
Yes and yes! |
6 tasks
austincondiff
requested changes
Apr 19, 2025
Collaborator
austincondiff
left a comment
There was a problem hiding this comment.
Wow, very impressive! I can see a lot of consideration went into this. Great work!
There are just a few minor issues I have noted.
...eEditSourceEditorExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Show resolved
Hide resolved
Example/CodeEditSourceEditorExample/CodeEditSourceEditorExample/Views/ContentView.swift
Show resolved
Hide resolved
Example/CodeEditSourceEditorExample/CodeEditSourceEditorExample/Views/Toolbar.swift
Show resolved
Hide resolved
Sources/CodeEditSourceEditor/Controller/TextViewController+FindPanelTarget.swift
Show resolved
Hide resolved
Sources/CodeEditSourceEditor/Controller/TextViewController+LoadView.swift
Show resolved
Hide resolved
Collaborator
Author
|
Alright @austincondiff now that CETV has been updated I think I've corrected everything you commented on. |
austincondiff
approved these changes
Apr 21, 2025
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.
Description
Adds a minimap to the editor.
Specific changes:
MinimapView. This view acts as the container view for the entire minimap contents including the separator, text bubbles, and scroll view.MinimapContentViewDisplays the real contents of the minimap. The layout manager and selection manager place views and draw into this view.MinimapLineRendereruses the new layout overriding APIs to render small bubbles rather than text for the minimap. This delegates all bubble calculation and drawing to a custom viewMinimapLineFragmentView.MinimapLineFragmentViewis a subclass ofLineFragmentViewthat calculates and draws bubbles instead of text based on the foreground color of the line fragment it displays.showMinimapparameter toTextViewControllerandCodeEditSourceEditortypes.updateContentInsetsupdates all relevant content insets for the scroll view, find panel, and minimap in one central place. This method is deterministic and builds on work @austincondiff and I discussed.updateTextInsetsupdates the text view's insets.Example app:
Related Issues
Checklist
Screenshots
Demo resizing & toggling minimap with selections being drawn and responding to scrolling.
Screen.Recording.2025-04-17.at.10.19.14.AM.mov
Demo scrolling a long document
minimap-long-demo.mp4
Demo editing text, with selections, dragging, and syntax highlighting. Note that syntax highlights haven't been updated to highlight the entire minimap visible region. That will be done, but adding to this PR I think will complicate this PR too much.
minimap-editing-demo.mp4