-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Allow folds to be toggled by clicking icons in the gutter #1441
Conversation
It blends in better with the methods on Editor.
@gutter.on 'mousedown', '.foldable .fold-icon', (e) => | ||
bufferRow = $(e.target).parent().data('bufferRow') | ||
@editor.toggleFoldAtBufferRow(bufferRow) | ||
return false |
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.
Don't need the return
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.
What got into me? Amateur hour.
Does this add any overhead to the rendering time of the gutter to lookup the foldability of the row? |
Looks rad. How does this work with bookmarks? |
@benogle: Good question. I need to check that out. |
@benogle: Thanks for the heads up. Looks like bookmarks are totally hosed. Any ideas? We could...
|
Refs #907 |
Bookmarks dont need to be clickable. Maybe left of the numbers provided there isnt too much crowding? Or maybe some other indicator like a colored background on the line number? i say try them on the left first. |
@benogle If they don't need to be clickable I'd prefer for them to supersede the fold indicators until the gutter is hovered. Otherwise we need to make the gutter quite a bit wider either always or when a bookmark is enabled. |
Ok. If it is weird, we can change it. |
In the gif I don't see the icon on 601 but multi-line doc blocks are foldable I thought. |
@kevinsawicki Yeah good I didn't add the indicators for docs comment blocks. |
I like this. I like how they dont show up at all til you hover, and the blue arrows when bookmarked. |
Using an adjective blends in better with '.foldable'
I now realize this feature requires foldability to be something we track persistently, whereas before we were determining it at a specific point in time. Going to need to bake it deeper into the cascade, probably associated with |
Left to do:
fold
class tofolded
to matchfoldable
I changed the layout of the gutter a bit to make the fold icon a real element rather than using pseudo elements. This is because I needed to detect if the icon specifically was clicked. I also opened up a bit more space in the gutter so things don't feel too squished.