Problem with Code Folding with Block Comments changed to Line Comments

Problem with Code Folding with Block Comments changed to Line Comments

115
Power UserPower User
115

    May 13, 2016#1

    While working on a project I wanted to have two different colors of comments so I could quickly locate code blocks that were commented out on a short term basis. Since the language involved is Interactive Data Language (IDL, but not to be confused with some other languages called IDL) and IDL does not have block comments, I used the option of creating a Block Comment On value without a Block Comment Off and also did the same for the Block Comment On Alt. This is listed in the UltraEdit Syntax Highlighting help documentation as a way to get up to four sets of line comments. These extra line comments are supposed to be the same as ordinary line comments. But they don't act the same entirely.

    Unlike words in ordinary Line Comments, words in the line comments made from Block Comments trigger code folding matches. In order to stop that, I had to add the comment marker characters to the /Ignore Fold Strings line. That worked, but in turn it killed my Comment Fold Strings.


    UE 21.20.0.1004, Windows 7 Enterprise

    6,681583
    Grand MasterGrand Master
    6,681583

      May 14, 2016#2

      I'm not able to reproduce this with 32-bit UE v22.20.0.49 on Windows XP.

      This is the beginning of the syntax highlighting wordfile I use for my batch files:

      Code: Select all

      /L1"Batch Files" Nocase Line Comment Num = 4rem  Line Comment Alt = :: Line Comment Valid Columns Alt = [1] Block Comment On = echo Block Comment On Alt = :# String Chars = " DisableMLS File Extensions = BAT CMD
      /Delimiters = ! $	'()*+,./:;<=>@[\]^`{|}~
      /Function String = "%:#++^([~^t^p :]+^)[ ^t]++$"
      /Indent Strings = "("
      /Unindent Strings = ")"
      /Ignore Strings SOL = "rem " "::"
      /Open Brace Strings =  "(" "[" "{"
      /Close Brace Strings = ")" "]" "}"
      /Open Fold Strings = "("
      /Close Fold Strings = ")"
      /Marker Characters = "!!%%"
      
      Note: The character between $ and ' in second line is a horizontal tab character.

      I tested code folding with a *.bat file containing:

      Code: Select all

      @echo off
      rem Opening parenthesis (
      echo Test 1
      rem Closing parenthesis )
      
      :: Opening parenthesis (
      echo Test 2
      :: Closing parenthesis )
      
      echo Opening parenthesis (
      echo Test 3
      echo Closing parenthesis )
      
      :#Opening parenthesis (
      echo Test 4
      :#Closing parenthesis )
      
      if not "%USERNAME%" == "%USERPROFILE%" (
          echo Test 5
      )
      
      (
          echo Done.
      )
      
      Code folding is correct available only for the last two pairs of parentheses.

      I don't have Open/Close Comment Fold Strings defined at all. Therefore this test might not be the right one for this issue.

      Mick, could you post the beginning of the wordfile used for syntax highlighting Interactive Data Language files and an example IDL file demonstrating the issue?
      Best regards from an UC/UE/UES for Windows user from Austria

      115
      Power UserPower User
      115

        May 17, 2016#3

        Here is the top of my modified IDL.UEW file.

        idl_uew_top.png (44.58KiB)

        Here are examples of folding issues. When I remove the line Ignore Fold Strings =";*" then I get the wrong result on the top of the image. You can see that the PRO (procedure) keyword is matching with the comment word end because it is in a block comment that has been converted to a line comment.

        If you look at the bottom of the image you see where the comment fold strings are ignored because they are in the converted block comment. This happens whether the Ignore Fold Strings line is present or not.

        wrong_folds.png (62.34KiB)

        Now this image shows a couple of comments that are composed of true line comments. Here the comment fold strings work correctly.

        right_fold1.png (24.46KiB)

        6,681583
        Grand MasterGrand Master
        6,681583

          May 19, 2016#4

          I could reproduce this issue and found others on testing block comment folding for nested block comments. I have just sent two emails to IDM support, see the files in the attached RAR archive.
          comment_fold_test_report.rar (1.6 KiB)   73
          This RAR archive contains the test files and the reports sent to IDM support.
          Best regards from an UC/UE/UES for Windows user from Austria