Menu

#1458 TextTools: Toggle Line Comment case sensitive

None
pending-fixed
nobody
None
5
2017-11-02
2011-09-26
No

In batch.xml rem is declared as line comment property. Rule ignore_case="true".
Trying to toggle a line like this:

REM copy asdf

results in:

rem REM copy asdf

Desired behaviour: uncomment line.

Discussion

  • Skeeve

    Skeeve - 2017-11-01

    The problem here is that "lineComment" is defined in PROPS while case-sensitivity is defined per ruleset.

    So there is no way (currently) to define that the lineComment string is case insensitive.

    My proposal would be to simply treat EVERY lineComment as being case-insensitive.

    For this, change in TextToolComments.java

    Line 126 from

                        if(line.length() > 0 && !line.startsWith(lineComment))
    

    to

                        if(line.length() > 0 && !line.toLowerCase().startsWith(lineComment.toLowerCase()))
    

    and line 172 from

                    if(line.trim().startsWith(lineComment) && doUncomment)
    

    to

                    if(line.trim().toLowerCase().startsWith(lineComment.toLowerCase()) && doUncomment)
    
     

    Last edit: Skeeve 2017-11-01
  • Skeeve

    Skeeve - 2017-11-02
    • status: open --> pending-fixed
    • Group: -->
     

Log in to post a comment.