You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using origami for a major mode I'm working on, where i use a very simple origami-markers-parser.
However the sizes of the begin and end marker strings are different, and when closing all the nodes it produces unexpected results.
For example
with (origami-markers-parser "12" "7890") on the string 1234567890 i expect 12...7890, but see 1234...7890
with (origami-markers-parser "abcd" "lm") on the string abcdefghijklm i expect abcd...lm, but see ab...lm
Both scenarios can be reproduced by the code at the end of this description (paste in *scratch* and M-x eval-buffer.
I looked in the code, and there appears to be a one line fix in origami-parsers.el
modified origami-parsers.el
@@ -135,7 +135,7 @@ position in the CONTENT."
((equal (caar positions) close)
(if beg
(progn ;close with no children
- (setq acc (cons (funcall create beg (cdar positions) (length close) nil)
+ (setq acc (cons (funcall create beg (cdar positions) (length open) nil)
acc))
(setq positions (cdr positions))
(setq beg nil))
If needed I can create a pull-request with this fix. I don't know whether it breaks any other scenario.
The text was updated successfully, but these errors were encountered:
peterpaul
changed the title
Folding of origami-markers-parser with unbalanced sizes displays wrongly.
Folding of origami-markers-parser with unbalanced sizes displays incorrect.
Dec 11, 2018
I'm using origami for a major mode I'm working on, where i use a very simple origami-markers-parser.
However the sizes of the begin and end marker strings are different, and when closing all the nodes it produces unexpected results.
For example
(origami-markers-parser "12" "7890")
on the string1234567890
i expect12...7890
, but see1234...7890
(origami-markers-parser "abcd" "lm")
on the stringabcdefghijklm
i expectabcd...lm
, but seeab...lm
Both scenarios can be reproduced by the code at the end of this description (paste in
*scratch*
andM-x eval-buffer
.I looked in the code, and there appears to be a one line fix in
origami-parsers.el
If needed I can create a pull-request with this fix. I don't know whether it breaks any other scenario.
Here's the code to reproduce the issue:
The text was updated successfully, but these errors were encountered: