#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 , 17 years ago
| Version: | Other |
|---|
follow-up: 3 comment:2 by , 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.
comment:3 by , 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 , 17 years ago
| Resolution: | → Completed |
|---|---|
| Status: | new → 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

Automatic ticket cleanup.