Sublime Forum

Fold/Unfold selects text

#1

If i fold or unfold a region (zc/zo || Ctrl+Shift+/]) it also selects the folded/unfolded text. How can i get rid of this behavior? Moreover, why this is useful at the first place?

0 Likes

#2

bump

0 Likes

#3

I’m also very interested in this! Anybody have insights?

0 Likes

#4

I assume it happens so that you can easily refold the text, but I can see why it would be annoying.

0 Likes

#5

This is terribly frustrating… is there an option to turn this off?

0 Likes

#6

The default behaviour is what it is (and doesn’t bother me personally).

One can work around this behaviour with a macro. For example, to unfold without leaving a selection, create a .sublime-macro file in your User folder and paste the following into it:


	{
		"args": null,
		"command": "unfold"
	},
	{
		"args":
		{
			"by": "characters",
			"forward": false
		},
		"command": "move"
	}
]

Something similar can be done for folding as well. Rebind your Ctrl+Shift+ key to the above macro and you should have what you want.

:smile:

0 Likes