sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
812 stars 39 forks source link

Folded regions should keep folded when being moved (e.g. via `swap_line_up` and `swap_line_down`) #5801

Open deathaxe opened 1 year ago

deathaxe commented 1 year ago

Problem description

Selecting a line which contains a folded region and moving it up or down via swap_line_up or swap_line_down unfolds the folded code block.

It is a surprising behaviour and might result in loosing track of content if unfolded region expands to several dozens or hundreds of lines.

Animation

Preferred solution

Treat folded regions as part of current line and move them together with the whole line without unfolding them or changing selection.

Alternatives

?

Additional Information

No response

deathaxe commented 1 year ago

Note: Folding state should also be maintained for normal copy & paste operations (see https://github.com/sublimehq/sublime_text/issues/494).