-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code folding #1113
code folding #1113
Conversation
@gensofubi can you describe in more detail how you are going about adding the outliner support (since we had discussed a number of possible approaches when we chatted) |
Nice demo yesterday btw! The code looks good to me, and the actual feature feels robust to play with. |
Thanks for the advice for apprearance. I've used the style of the buttons in the top bar, and unicode triangle symbols for 🞂 and 🞃. |
Hi Tao! I'm trying to expand the breadcrumb bar for your module view system, could u merge dev to enable me to start working on it? Or maybe I could work on this branch? Thanks a lot! |
Got it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready to merge
@disconcision can you take a look at this when you get a chance |
Marking this as draft and pending -- would like a folding UI like this PR, but based on @disconcision's work on #1218. |
closing in favor of projectors-based approach in #1218 -- thanks for the effort on this @gensofubi. I think we might want something that looks more like this at some point, even if based on projectors. |
module view.
The target is to make a foldable view for module definitions. Currently I'm going to add a id map indicating whether a module definition is folded, which is similar to how the values of livelits are stored in #955 . (I think that binding the collapse property to an expression means that we need a new label to represent the collapsed module (since tile has no other parameters to help distinguish it), and by clicking the button to replace an exp having a certain id with another one looks tricky)
Current progress: Added a clickbox before every module defining expression. Fixed the relative position of select shadowing. Solve the problem that a clickbox also appears in the backpack view. Add a folded view which replace the definition code if checkbox is checked.
Disabled Caret moving into folded codes. If caret at the side of a folded part, pressing left or right will move it to the other end. Other movement behavior: up/down/home/end behave normally. Clicking on the second half of the ellipsis will move the cursor to the side opposite the initial position. When continuously pressing Tab, cursor stops exactly once at the ellipsis if any holes (no matter how much) appear in the omitted part.
Another small issue: selection sometimes cause the omitted holes to appear.
Move the checkbox to the side of editor. Only the first module expression in each row will have fold button.
Change the checkbox to a button because the checkbox's default checking appearance seems not coordinate well with my code.
Automatically Move the cursor at the beginning of module statement when folding, to avoid the cursor being inside folded codes.
Create a shortcut to fold/unfold (ctrl+shift+'['/']').
Hide the fold button. Display on hoveringUse the botton style in top bar.