Home Download Buy Blog Forum Support

Folding is not as dynamic as it could be

Folding is not as dynamic as it could be

Postby SCdF on Thu May 17, 2012 2:46 am

Let's say you have some text: (example1)
Code: Select all
Section 1:
   A thing
   Another thing
Section 2:
   A third thing
   One more thing
   Even more one more thing

If you fold on Section 1 you see: (example2)
Code: Select all
Section 1: [...]
Section 2:
   A third thing
   One more thing
   Even more one more thing

If you put your caret over Section 2: and move the line up (ctrl+shift+up) you see: (example3)
Code: Select all
Section 1:[...]Section 2:
   Another thing
   A third thing
   One more thing
   Even more one more thing

If we set this back to example2, and then move Section 2 down a line, we get this: (example4)
Code: Select all

Section 1:[...]
   One more thing
Section 2:
   Even more one more thing


In terms of what should happen, I imagine example3 should either have Section 2 on its own line, or it should unfold the entire section (because you are technically now editing something inside the scope of the fold.

With example 4, I imagine the correct thing would be to have 'One more thing' be encompassed by the fold when you move Section 2 past it.
SCdF
 
Posts: 4
Joined: Wed Feb 29, 2012 8:46 pm

Re: Folding is not as dynamic as it could be

Postby qgates on Mon Nov 12, 2012 4:41 am

Confirm the above behaviour.

Folding is nearly (but not really) great in sublime. The behaviour when using line-up and line-down as the above post points out is spurious and certainly not reliable. With these wrinkles ironed out ST2 could easily replace the functionality of the Outliner in Word for example, about the only feature left in Word that I actually like ;)

Other folding weirdness:

1. selecting the folded line with Ctrl+l and cutting Ctrl+x, while selecting the fold, does not cut it. It only cuts the visible (parent) line of the fold, leaving the folded lines folded, the parent line empty and the fold mark still visible.
2. selecting the folded line with Home then Shift+end DOES however correctly cut the entire fold, allowing it to be pasted elsewhere. In this case though it'd be much nicer to see the pasted section remain folded.

Finally, how can we define folding for particular language types like Markdown for example? It seems that Sublime ignores tmLanguage hints for folding, or am I wrong?

S
qgates
 
Posts: 223
Joined: Mon Nov 05, 2012 4:33 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 19 guests