Closed marcel0ll closed 8 years ago
With the last commit everything should be working. Now you can click on the gutter to close a region
Whoah, thanks a lot! Reviewing now.
The logic looks sound, unfortunately the click handler doesn't seem to work (at least with Atom 1.10.0).
$(gutter) on my system results in "VM38:1688 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '[object HTMLDivElement]' is not a valid selector."
A potential solution might be to do a click handler on the document as a whole and check for the target to see if it's fold icon we created.
Another solution would be to dynamically add and remove click handlers for each fold icon.
Note that I initially thought it was working when I defined a foldable region without anything inside - just the start and end tags. But once I added a code in between the tags it no longer folded. My guess is that Atom's built-in folding code was being triggered for what it thought was a comment block.
I had a similar bug with a non-code file. I will check what is going on, but here it is working perfectly
yessss! so glad to see this implemented.
Thanks so much for taking the time to do this!
I found a way to create a click event on the fold icon, but was unable to find a good place to add a call to it (_addClickEvent)