Folding via fold/unfold commands selects folded/unfolded text #5797
Open
Description
Description of the bug
Folding experience differs depending on using fold buttons or key bindings.
Steps to reproduce
- Start ST in SAFE MODE...
- Paste the following code into a new view and set Python syntax
def function(): """ This is a funciton :returns: nothing """ pass
- Move caret after the opening doc comment punctuation (end of line 2)
- Hit
ctrl+shift+[
to fold the comment (=> folded region is selected, caret moved to the end) - Move caret back to original position
- Hit
ctrl+shift+]
to unfold the comment (=> folded region is selected, caret moved to the end)
Expected behavior
Folding and unfolding should
- not manipulate selections, except removing those from folded regions.
- not move caret in case it is already at the beginning or the end of a folded/unfolded region.
Folding/unfolding should behave the same way, no matter whether it is invoked via fold buttons or key bindings.
Actual behavior
Folded regions and unfolded regions are selected with the caret being placed at the end of the folded region.
Sublime Text build number
4147
Operating system & version
Windows 10
(Linux) Desktop environment and/or window manager
No response
Additional information
No response
OpenGL context information
No response