Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 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 Changed 15 years ago by TicketCleanup

  • Version Other deleted

Automatic ticket cleanup.

comment:2 follow-up: Changed 15 years ago by 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.

comment:3 in reply to: ↑ 2 Changed 15 years ago by anonymous

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 Changed 15 years ago by Jos

  • Resolution set to Completed
  • Status changed from new to closed

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 Changed 15 years ago by TicketCleanup

  • Milestone set to Future Release

Automatic ticket cleanup.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.