Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
origami-toggle-node cannot toogle at the beginning of the node #42
Comments
ninrod
commented
Oct 17, 2016
|
+1. @gregsexton! Here's a screenshot to demonstrate: point is above the Being able to open or close a fold anywhere in a line that contains a fold would be a significant comfort improvement. |
ninrod
commented
Oct 17, 2016
|
In my specific use case, I think the way to go would be to change the regex listed here. Makes sense? |
ninrod
added a commit
to ninrod/dotfiles
that referenced
this issue
Oct 18, 2016
jojojames
commented
Jan 27, 2017
|
+1 I don't think any other folding packages support this behavior. I like how vim does its folding. |
ninrod
commented
Jan 27, 2017
•
|
you can circumvent the behaviour by constructing a custom function with |
jojojames
commented
Jan 27, 2017
|
@ninrod That's a good head start.
I'll probably have to tweak it to do a 'lookahead' for 1 or 2 lines before giving up and going upwards up the stack. |
ninrod
commented
Jan 27, 2017
|
@jojojames yes that's the spirit. |
jojojames
commented
Jan 27, 2017
|
@ninrod Uses s.el for the string parsing.
|
ninrod
commented
Jan 27, 2017
|
@jojojames, I only use vim's |
|
The behaviour of origami-toggle-node you describe is by design. You should use origami-forward-toggle-node. IIRC, this won't work across lines though - again this is by design so as not to be surprising. You should be able to easily compose origami-forward-fold (jumps to the next folding point) and origami-toggle-node to get the behaviour you want. No need to parse the buffer. |
gregsexton
closed this
Jan 28, 2017
ninrod
commented
Jan 28, 2017
|
by the way thank you for the awesome package @gregsexton! |

c02y commentedSep 18, 2016
•
edited
Fox example:
the point is at beginning of the "int main" line, the ">" position (or any position before the symbol "{"), executing origami-toggle-node will do nothing, but expected to toggle the whole function, it only works inside the function (inside the "{...}"). But origami-recursively-toggle-node or origami-toggle-all-nodes work as expected. even from the beginning of the node.
BTW: origami-toggle-node works at the beginning of a defun line in elisp file.