Sublime Forum

ST4: Code Folding Level 1 Issues

#1

Hi, this issue has been persisting for several versions now. I have seen several discussions on the topic, but I do not think the issue is fully resolved.

Given the following snippet:

describe ExampleClass do
	if "foo" do
		# comment
	end
	
	if "foo" do
		# comment
	end
	
	if "foo" do
		# comment
	end
end
describe ExampleClass2 do
	if "foo" do
		# comment
	end
end

The current behavior of sublime with fold_style = “force_indentation” causes the Level 2 items to be folded as well within the level 1 block where the cursor is located:

image

Previously (I believe in version 4126) this was not the case. Instead, when folding level 1 (Ctrl + K, Ctrl + 1), Sublime would ONLY fold code outside of the current Level 1 block like so:

image

This was how it functioned and actually how VS Code currently behaves if you wish to test and see.

Is “force_indentation” not the right setting for fold_style to achieve this effect? I think Code Folding LEVEL 1 is being conflated with Fold All, but it does hamper my work flow when I wish to fold all other level ones, but leave the current level 1 (and children) unfolded.

0 Likes

#2

“Fold All” Main Menu and Command Palette items had been changed from calling fold_all to fold_by_level, maybe to avoid caret to become hidden.

fold_all still works, though, and can be re-bound.

0 Likes