Community
    • Login

    Issue if Folding in code

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 118 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Zachary DeckerZ
      Zachary Decker
      last edited by

      Hi all

      I use Notepad++ to code in a language for Igor Pro by Wavemetrics. I’ve used user defined language for years. Recently, the folding in code has stopped working properly. It starts and stops at seemingly random spots.

      Below I have the settings I have been using and some example code, which the issue visible.

      Thanks for any help

      Debug output
      Notepad++ v8.7.7 (64-bit)
      Build time : Feb 6 2025 - 03:19:13
      Path : C:\Program Files\Notepad++\notepad++.exe
      Command Line :
      Admin mode : OFF
      Local Conf mode : OFF
      Cloud Config : OFF
      Periodic Backup : ON
      Placeholders : OFF
      DirectWrite : ON
      Multi-instance Mode : monoInst
      File Status Auto-Detection : cdEnabledNew (for current file/tab only)
      Dark Mode : OFF
      OS Name : Windows 11 Pro (64-bit)
      OS Version : 24H2
      OS Build : 26100.3194
      Current ANSI codepage : 1252
      Plugins :
      mimeTools (3.1)
      NppConverter (4.6)
      NppExport (0.4)

      c0abf520-d17c-41a1-a541-0cd301519849-image.png

      f6f3a494-4444-4403-b96d-f9f1e6959052-image.png

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Zachary Decker
        last edited by

        @Zachary-Decker said in Issue if Folding in code:

        Recently, the folding in code has stopped working properly.

        Nothing has changed recently with the implementation of User Defined Languages (UDL).

        But UDL has never been perfect, and over the years, I’ve seen plenty of times when UDL code-folding gets out-of-sync with the file. It often happens when the first line of the file in question is a comment line or beginning of a comment block. Given that your first line has a comment on it, that might be the culprit. Sometimes (as described in this issue) users are able to get it to re-sync the fold points by choosing Language > None and then choosing Language > <name of UDL> to do a manual reset; but that’s not a guarantee.

        You don’t show your Comment & Number settings, but this official issue reports that setting the Allow folding of comments option on that tab of the UDL might “break” the normal UDL folding for you. If you don’t need comment-folding, I would suggest turning it off, and see if it helps the other folding to work more reliably.

        Zachary DeckerZ 1 Reply Last reply Reply Quote 1
        • Zachary DeckerZ
          Zachary Decker @PeterJones
          last edited by

          @PeterJones

          Thanks for the reply. I followed your suggestions, but these did not resolve the issue.

          However, I did find a solution after much troubleshooting. You noted that there can be issues if the first line is a comment. This is not the case in my file, but I realized the folding issue was correlated with the number of comments. Playing around with the Comment settings in the Comment & Number tab shows this to be true. I had some strange settings going on in there which worked for the comments, but screwed up the folding.

          a2656615-892c-4d50-a4e1-4423abdcf958-image.png

          Removing the Comment Style settings fixed the issue.

          Thanks
          Zach

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors