Developers Jos Posted September 28, 2010 Developers Posted September 28, 2010 (edited) Uploaded a new beta version of Tidy.exe v 2.2.0.11 (Feb 1, 2011) and tidy.ini which has the following updates: Additions/Changes: - removed the 4096 record limit. - added support for UTF8 with BOM files. - added option /region_indent or /ri which will indent #region-#endregion sections. - Set variable name case for variables as defined in the Constants included files. Parameter /prc or /properconstants support is added for this function because it will slow down the Tidy process and by default it is off. e.g.: #Tidy_Parameters=/prc=1 Tidy.ini: [ProgramSettings] * * * (tabchar) Indent setting: 0 = Tabs > 0 = Number of Space tabchar = 0 * * * Update Functions / Keywords / Macros / UDFs To Proper Case proper = 1 * * * Update Constants defined in the "constant Include files" properconstants = 0 BugFixes: - Fixed proper casing Keywords when they "look like a Function" e.g. switch ($a=1) - Fixed space removal after ( when /Delim=0 - Fixed space addition Between sting and closing brace in case of a Dot after the Brace. This was a major rewrite of the internal file-handling, reading and memory handling of the script records so need it to be tested. While testing I would advice to run winmerge automatically so you can actually check what was changed by tidy to ensure you do not screw up a working script. I use this line in Tidy.ini to accomplish this: ShowDiffPgm = """C:\Program Files (x86)\WinMerge\winmergeu.exe" "%new%" "%old%""" Could use some members to do some good testing to ensure things still work properly. Thanks jos Edited February 4, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
GEOSoft Posted September 28, 2010 Posted September 28, 2010 I shall begin testing tomorrow, just to appease you oh most revered one. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Valuater Posted September 28, 2010 Posted September 28, 2010 (edited) I love this program, it makes me look good.I know how much I hate to re-enter a working program and try to re-write it... or even up-date it. Thanks for the effort Jos, It is appreciated by many!!!I will start testing and post any helpful feedback.Valuater8) Edited September 28, 2010 by Valuater
water Posted September 29, 2010 Posted September 29, 2010 Many thanks for this great program! I will start testing right now! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
bo8ster Posted September 30, 2010 Posted September 30, 2010 No issues spotted, tired with different statement types, indentation, spaces and function. Outstanding tool for AutoIt use it a lot, thanks! Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
stoyan Posted September 30, 2010 Posted September 30, 2010 (edited) Hello all,here are my observations so farThe changes in my tidy.iniendfunc_comment = 0The original code:EndFunc ;==>{function name here}Note the three spaces before the ';' sign.The tidied up code:EndFunc ;==>{fucuntion name here}There is only one space before the ';' sign.I'm really not sure what the expected behavior would be. The same happens with the tidy.exe v.2.1 Edited September 30, 2010 by stoyan ; Opt('MustDeclareVars', 1)
Developers Jos Posted September 30, 2010 Author Developers Posted September 30, 2010 I'm really not sure what the expected behavior would be. The same happens with the tidy.exe v.2.1It is expected behaviour to strip the spaces at the end of the code and add a space and then the end-of-line comment.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
stoyan Posted September 30, 2010 Posted September 30, 2010 It is expected behaviour to strip the spaces at the end of the code and add a space and then the end-of-line comment.My bug reports a bad, I have to practice. What I meant with the previous port was that with 'endfunc_comment = 0' the output is different then the one with 'endfunc_comment = 1'. The difference is in those two spaces before the comment character. The description in the ini says Added comment To EndFunc statement E.g. "EndFunc ;==>UDF_Name"It wasn't clear to me what to expect when turn this feature on or off. ; Opt('MustDeclareVars', 1)
Developers Jos Posted September 30, 2010 Author Developers Posted September 30, 2010 No worries, appreciate the feedback! Understand that it is different and probably could be called inconsistent, but when 'endfunc_comment = 1' is used the fixed text is added with the extra spaces. When 'endfunc_comment = 0' is used it follows the standard behaviour which is what I described. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
stoyan Posted October 1, 2010 Posted October 1, 2010 (edited) Here's one for real.Consider the following:#include <Array.au3> if $cmdline[0] > 0 Then _ArrayDisplay($cmdline) endifWhen tidied the result is:#include <Array.au3> f $cmdline[0] > 0 Then _ArrayDisplay($cmdline) ndifIf new line is added just before the 'EndIf' the result is#include <Array.au3> f $cmdline[0] > 0 Then _ArrayDisplay($cmdline) ;### Tidy Error: next line creates a negative tablevel. ;### Tidy Error: next line creates a negative tablevel for the line after it. EndIfThe result gets even more devastating the larger the file is.This occurs if and only if the line ending in the target file are UNIX type. Not tried the mixed line endings case.I guess you've got an assumption about the length of the new line white space.Ideally the fix will result in adding a switch in the ini about the preferred line ending char(s).Edit: Or keep them intact altogether. Edited October 1, 2010 by stoyan ; Opt('MustDeclareVars', 1)
stoyan Posted October 1, 2010 Posted October 1, 2010 (edited) One more.Source:#include <Array.au3> If $cmdline[0] > 0 Then _ArrayDisplay($cmdline) EndIfThe result:#include < Array.au3 > f $cmdline[0] > 0 Then _ArrayDisplay($cmdline) ndifNote the include lineThe source file is UTF-8 with BOM and UNIX LE.Edit: The includes related issue is not LE related. Edited October 1, 2010 by stoyan ; Opt('MustDeclareVars', 1)
Developers Jos Posted October 1, 2010 Author Developers Posted October 1, 2010 Ideally the fix will result in adding a switch in the ini about the preferred line ending char(s).Edit: Or keep them intact altogether.Understand the bug and will have a look at that to support also single char line endings.Will also look at the UTF8 file issue... could you PM me the original file as you use it?ThanksJos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted October 1, 2010 Author Developers Posted October 1, 2010 Uploaded v 2.2.0.1 which fixes the Single char line endings issue. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted October 1, 2010 Author Developers Posted October 1, 2010 Uploaded v 2.2.0.2 which fixes the UTF8 issue reported by stoyan. Thanks for the testing SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
stoyan Posted October 1, 2010 Posted October 1, 2010 could you PM me the original file as you use it?Just for further reference I'm attaching the test files.I can confirm that the two issues are fixed in v 2.2.0.2Thank you.testcase.zip ; Opt('MustDeclareVars', 1)
stoyan Posted October 1, 2010 Posted October 1, 2010 Unfortunately you аssume LE consistency.LE - mixed;UTF-8+BOM.zip ; Opt('MustDeclareVars', 1)
Developers Jos Posted October 1, 2010 Author Developers Posted October 1, 2010 You seriously have files that have partially CRLF and partially CR or LF? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators Melba23 Posted October 1, 2010 Moderators Posted October 1, 2010 A foolish consistency is the hobgoblin of little mindsRalph Waldo EmersonBut consistency in file line endings I would consider anything but foolish. I would call it entirely normal - if not essential! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Richard Robertson Posted October 1, 2010 Posted October 1, 2010 I believe that there should be an option in Tidy to normalize the line endings.
Valik Posted October 1, 2010 Posted October 1, 2010 For what it's worth, my opinion is that Tidy should read in files with mixed line endings and then just normalize them. It doesn't need to be complex, just normalize to the first line ending or something (or use a hard-coded setting). Some simple logic to read in files with mixed line endings is to just replace the CRLF combination with LF, then replace all remaining CR with LF. Any existing LF will go unchanged. Then on writing just convert LF to the desired normalized ending.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now