In ESS
mode with hs-minor-mode
on, I want to collapse only those comments which directly belong to a function, not other comments which are separated by newlines. Take this example:
##############
## Section foo
##############
#' This does foobar
#' Returns nothing.
foobar <- function(x) message("hello")
What I would like the comments to fold into is:
##############
## Section foo
##############
#' This does foobar...
foobar <- function(x) message("hello")
And what I get so far is just:
##############...
foobar <- function(x) message("hello")
Now, is there a way to fold just some "connected" comment sections and keep others unfolded?