4

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?

quazgar
  • 341
  • 1
  • 11

1 Answers1

0

Check this variable out hs-hide-comments-when-hiding-all

hs-hide-comments-when-hiding-all is a variable defined in ‘hideshow.el’. Its value is t

Documentation: Hide the comments too when you do an ‘hs-hide-all’.

You can customize this variable.