Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#848 closed Feature Request (Completed)

Tidy.exe - enhancement to '/rel : Remove empty lines from the source.' parameter

Reported by: Bowmore Owned by:
Milestone: Future Release Component: Other
Version: Severity: None
Keywords: Tidy.exe Cc:

Description

It would be nice if the Tidy.exe parameter

/rel : Remove empty lines from the source.

could have an optional flag 0|1
/rel 0 (default) would work as it currently does and remove all empty lines.

/rel 1 would reduce consecuative lines containing only whitespace to a single empty line. I believe that this will help to make the code more readable by removing excessive whitespace but leaving it where the author intended.

Example:
Running Tidy on the following code with proposed /rel 1 parameter

  ;--------------------------------------------
  $g_sTestRun = GUICtrlRead($GUI_edtTestRun)




  If $g_sTestRun = "" Then
    $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage)
    Switch $iMsgBoxAnswer
      Case 4 ;Retry
        Return
      Case 2 ;Cancel
        Exit
    EndSwitch
  EndIf


  $g_sTestCase = GUICtrlRead($GUI_edtTestCaseId)

  If $g_sTestCase = "" Then
    $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage)
    Switch $iMsgBoxAnswer
      Case 4 ;Retry
        Return
      Case 2 ;Cancel
        Exit
    EndSwitch
  EndIf
  ;--------------------------------------------

would produce the following output.

  ;--------------------------------------------
  $g_sTestRun = GUICtrlRead($GUI_edtTestRun)

  If $g_sTestRun = "" Then
    $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage)
    Switch $iMsgBoxAnswer
      Case 4 ;Retry
        Return
      Case 2 ;Cancel
        Exit
    EndSwitch
  EndIf

  $g_sTestCase = GUICtrlRead($GUI_edtTestCaseId)

  If $g_sTestCase = "" Then
    $iMsgBoxAnswer = MsgBox(53, "Warning", $sMessage)
    Switch $iMsgBoxAnswer
      Case 4 ;Retry
        Return
      Case 2 ;Cancel
        Exit
    EndSwitch
  EndIf
  ;--------------------------------------------

Attachments (0)

Change History (5)

comment:1 by TicketCleanup, 17 years ago

Version: Other

Automatic ticket cleanup.

comment:2 by Jos, 17 years ago

Just wondering why you are not siply putting a ; on the lines you want to keep?
That is what I do when I want to have an empty seperator line.

in reply to:  2 comment:3 by anonymous, 17 years ago

Replying to Jos:

Just wondering why you are not siply putting a ; on the lines you want to keep?
That is what I do when I want to have an empty seperator line.

That is what I do when I remember to, but offten I forget and when I run Tidy with /rel I need to go back and put the blank lines back. No great hassal, but it would be nice to have the option to leave a single blank line.

comment:4 by Jos, 17 years ago

Resolution: Completed
Status: newclosed

I have added trhis option as it was pretty easy to do.
Check the Tidy version available in the Beta download directory.

INI
* Remove Empty lines from Script Source. 1=Remove all 2=Remove all more then 1
Remove_Empty_Lines=1
Remove_Empty_Lines=2

Commandline / #Tidy_Parameter:
/r_empty_lines or /rel 
/r_extra_empty_lines or /reel 

comment:5 by TicketCleanup, 17 years ago

Milestone: Future Release

Automatic ticket cleanup.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.