GMS 2 How to hide comments in the script?

Discussion in 'Programming' started by Suzaku, Jul 11, 2019.

  1. Suzaku

    Suzaku Member

    Jan 27, 2019
    It would be good if I could hide all my comments in the script using a hotkey or any other quick trick, this way when we are not needing to read any comments in the script we hide them so the script will be more readable and clean. Is that possible? Thank you.
  2. rIKmAN

    rIKmAN Member

    Sep 6, 2016
    The whole point of comments is to make your code more readable / understandable and remind you what a certain piece of code does should you come back to it later.

    You can't hide them, but if you wanted to you could enclose them in #region / #endregion tags and then use CTRL+M and CTRL+U to fold / unfold all regions. (CMD+M / CMD+U on Mac)
    Suzaku and Amon like this.
  3. samspade

    samspade Member

    Feb 26, 2017
    What @rIKmAN said. I use regions a lot. Not only can use CTRL + M/U to fold/unfold you can use CTRL + up/down to move to the next one up or down and CTRL + enter to toggle open/close on that specific region.

    If your comments are so bothersome you want to hide them, you might want to re-think your comment practice. There are tons of videos, articles out there about how to comment your code. I'd recommend reading/watching a bunch and coming up with a system you like.
    Suzaku likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice