Fold/Collapse removing white space. RStudio v1.0 and on.

Update to the below

I have now been working in the new RStudio and I got to say it is hard. I am getting ridiculous eye strain from trying to maneuver in my own code. There has to be some solution. Is there any way to retain white space when collapsing so that it looks like the screenshot below?


I finally updated to the new version of RStudio from an 0.99v. I noticed that RStudio (using Alt+O) automatically 1) fold/collapses whitespaces and 2) does not collapse comment chunks within larger code sections.

Item 1

I noticed that somebody had posted this issue over two years ago here. It looks like that conversation never picked back up. Anyone know of any resources beyond this post? I have far too many scripts leveraging whitespaces. It is rather frustrating to update RStudio only to have it not work as nicely as the old.

https://support.rstudio.com/hc/en-us/community/posts/245333367-RStudio-v1-0-44-Fold-removing-white-space

Item 2

To give some more detail on item 2 I noticed that, with the following code below, if I use Alt + O it will recognize the column binding section as its own.

# 1. Append Examples --------------------

################
# Column Binding #
################

In other words, if I enter Alt+O I will get the below. In the past it would not show the # symbols at all but collapse all of them within section # 1. Append Examples. Any help or support on this? I also happen to use these a lot.

Now (Alt+O)

# 1. Append Examples --------------------
################
################

Previously (Alt+O)

# 1. Append Examples --------------------

Thanks for the feedback. I believe this change was intentional, as a number of used desired a way to create un-named sections and did so with e.g. ##### to mark an unnamed section.

Sorry that this has negatively impacted your workflow -- to the best of my knowledge, there isn't a way to request the old behavior in newer versions of RStudio.


bnakey

6d

What about whitespaces (Item 1). Do you know of any fix on this issue? Or were you also referencing this as old behavior ? Also, I updated the post to include an example of what I am aiming for in reference to white spaces. For me, it's very nice to be able to space code sections like the above. It's both aesthetically pleasing, is easier to read, and also allows other users to easily distinguish between code sections (even before actually reading the code or section headers). In my line of work I have to create several scripts. All are for similar tasks. Point is, if I polish and organize my scripts as such, it becomes easier for other dependent users to follow. Right now, I cannot follow my own code and I doubt others will be able to.

There isn't currently a way to get back the old behavior. Would you mind filing this as a feature request at https://github.com/rstudio/rstudio/issues, just so we don't lose track of this?

I will do just that. Thank you for your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.