Feature request: word wrap

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
This topic is 14 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Feature request: word wrap

Post by Alexander Riedel »

Hi Bill.

We understand that word-wrap does not insert permanent new-line characters. Doing that is generally called 'reformatting' or "code beautifier" and is mainly implemented to NOT break anything but enhance readability and adherence to coding standards.

I have not seen any argument here that would point out any usefulness in word-wrapping code. In every single case structuring the code correctly is much more advantageous.

So please let us know what YOUR use case is.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
kenknicker
Posts: 21
Last visit: Fri Aug 11, 2023 10:19 am

Feature request: word wrap

Post by kenknicker »

I have not seen any argument here that would point out any usefulness
in word-wrapping code. In every single case structuring the code
correctly is much more advantageous.The responses we've seen from SAPIEN on this are very frustrating and, quite honestly, I'm fed up. As I see it:
SAPIEN's customers want it, need it, and have asked for it repeatedly.SAPIEN is saying "We know what's best for you and this is not it. You cannot have it."
Everyone's use case is the same: "Get more done more quickly" by having the tools behave as desired and expected. Adding this fundamental capability will not cause me to break my code.
Word wrap will not have a negative outcome on whether or not my code is structured correctly. In fact, we've recently decided to eliminate the practice of splitting lines of VBScript code at the 80-character mark -- it is a major drag to productivity. So word wrap would be more useful than ever before to us.Word wrap would let me see more code at the same time. If the line of code is lengthy then, when editing that line, I cannot see the nearby code so I have to scroll horizontally to review the context. I simply want the ability to see all of section of code I am working with on-screen without scrolling horizontally.Avoidance of obfuscation of an accidental CR/LF is a poor excuse. Want happy customers? Here's how:Add the word wrap feature.Keep it turned off by default.Those who want to use it will do so.Those who don't won't.Ken K.2009-10-09 14:35:06
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Feature request: word wrap

Post by Alexander Riedel »

You wrote: "In fact, we've recently decided to eliminate the practice of splitting lines of VBScript code at the 80-character mark -- it is a major drag to productivity."

Would you mind elaborating how not formatting code enhances productivity? Splitting at an arbitrary fixed column number sounds just as impractical as not formatting at all. So I am wondering what led you to that practice?

I think this is the main point of misunderstanding here. Anyone developer here at SAPIEN who would produce code that is not formatted according to standard practices would be let go. This sounds harsh but it is like that in every C++ shop I know. But with C++/C# developers this issue never even arises.
Considering that C++ and C# are not line oriented but VBScript IS line oriented that seems puzzling to me.

So please, as I asked before, give us real world examples.

And to respond to Ken's accusation, "SAPIEN is saying "We know what's best for you and this is not it. You cannot have it." let me point out that SAPIEN is not doing that.

Ken makes it sound as if we would maliciously withhold this feature even though we could just simply turn a knob and enable it. Adding word wrap to a code editor requires a very substantial effort to make it work correctly with coloring and code folding. While not impossible, at this time we feel that our efforts are better spent adding other, more important features.

Anyone listening in here can help by providing input either way. Please speak for yourself and your view and
do not try to generalize. We get a good deal of input on this through email, surveys and face-to-face conversations aside from this particular thread and statements with generalizations are simply more easily dismissed than actual personal experience.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
mlowe
Posts: 14
Last visit: Mon Feb 22, 2010 7:36 am

Feature request: word wrap

Post by mlowe »

OK, I will chime in on this one. I LIKE Primalscript. I've used it for years. I know all of the odd keyboard shortcuts, and have followed the adding and removing of features over the years. (Anyone else miss macro recording?)I personally want word wrap for HTML, XML, and text file editing. (And No, I don't use the XML editor.)Because I do a lot of searching, replacing, and data cleaning on files, it is nice to be able to grab a jumbled mess of code and see all of it.I am the cleaner, I end up doing a lot of maintenance on code written by the guys you fired (and their monkeys). I have found that PS is a valuable tool in my arsenal to help reformat and update poorly written code. Remember that a lot of us use PS as more than just a pure code IDE. We also use it for editing things that DO have long lines by nature, and sometime introducing those line breaks changes the meaning of what we are trying to render.
User avatar
kenknicker
Posts: 21
Last visit: Fri Aug 11, 2023 10:19 am

Feature request: word wrap

Post by kenknicker »

You wrote: "In fact, we've recently decided to eliminate the practice of splitting lines of VBScript code at the 80-character mark -- it is a major drag to productivity."Would you mind elaborating how not formatting code enhances productivity? Splitting at an arbitrary fixed column number sounds just as impractical as not formatting at all. So I am wondering what led you to that practice?We are not splitting at an arbirary fixed column--we are eliminating the practice of manually splitting code at *any* column. e.g.: If you change the following line of codeFROM THIS: If strGetValue = "" Then strGetValue = "Please enter a value for the widget."TO THIS: If strGetValue = "" AND strNewValue = "" AND strOldValue <> "" Then strGetValue = "Enter value of the string."...the line has to be manually parsed again to find a good spot to break it to work with the 80 character length rule. Removing the need to manually enter line breaks from the process speeds things along.Of course, we still use indention for formatting to identify conditionals, loops, etc. In fact, indention is another reason why we decided to stop using manually entered line breaks. If you get three for more levels deep into a set of nested IFs, there is little room left for code. Ken makes it sound as if we would maliciously withhold this feature even though we could just simply turn a knob and enable it. Adding word wrap to a code editor requires a very substantial effort to make it work correctly with coloring and code folding.I know it takes significant effort. But, for the record, you already have this in to the printing system--if a line of code is longer than the page is wide, the code wraps.What's so difficult about extending that capability to the editor?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Feature request: word wrap

Post by Alexander Riedel »

Ok, let me elaborate a little bit on what we are currently working on (which is a bit against policy) to maybe ease some of the hardened fronts here:

- The next version of PrimalScript will have three editors:
A code editor without word wrapA text editor with word wrap for arbitrary text files, no coloring, no foldingAn RTF editor for those on the fly docs and EULAs tou have to write

- The next version will also include a code reformatter,
for selected languages only at first, with various
options for common preferences.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Feature request: word wrap

Post by Alexander Riedel »

Ken, thank you for your response.

While I personally always write if statements like yours as

If strGetValue = "" AND strNewValue = "" AND strOldValue <> "" Then
strGetValue = "Enter value of the string."
End If

neither of those two would require word wrapping or scrolling on my screen to see it.
I guess I need to ask what size screen/window you use to write code?
Maybe you can email me a screenshot of a typical editor session to understand what you see.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Feature request: word wrap

Post by Alexander Riedel »

Oh and printing is static. Code editing is dynamic. Without going into coding details, it is quite a different task.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
kenknicker
Posts: 21
Last visit: Fri Aug 11, 2023 10:19 am

Feature request: word wrap

Post by kenknicker »

My example was contrived but the main point is that, with word wrap built in to the editor, the option is mine.If I can let the editor manage word wrap for me, I can stay more focused on fuddling though the bits of code. I like the idea of the IDE being able to manage this if I choose. I'm all about standards and quality formatting of code but the practice of modifying code to manually split strings is archaic. It forces the styling of the document to modify the structure of the code itself.For illustration, I'm providing two versions of a Class declaration written in VBScript. They both do the same thing although the code has changed a bit between the two versions. The script this Class is in was recently refactored. While doing so, we decided to remove all of the manual string splits. I think the code looks much better now and the logic is easier to follow. You tell me.Of course, it helps that I use really wide monitors so I can see a lot of code at once. But when I do want to see the code in smaller columns, I can't do it with SAPIEN, I have to re-open with Notepad++.Example #1 was written to conform with standard 80 char columns notation as shown here:'/////////////////////////////////////////////////////////////////////////////'Class LogonRules' Parse XML for logon rules'/////////////////////////////////////////////////////////////////////////////' Private s Private strComputerName, strUserName, m_objGroups, _ m_objComputer, m_objUser Public Sub Settings(ByRef objSettings) Set s = objSettings End Sub Public Sub Execute Dim objXMLDoc, blnSuccess Set objXMLDoc = CreateObject("Microsoft.XMLDOM") Call s.Debug("Parsing logon rules:", 0, 0) objXMLDoc.async = "False" blnSuccess = objXMLDoc.load(s.strXMLFile) If blnSuccess Then Dim strXPath, colNodes, objNode, colActions, _ colFilters, objAction Dim obj Dim i, j ' Make a collection of the actionSets strXPath = "//logonRules/actionSet" Set colNodes = objXMLDoc.selectNodes(strXPath) ' Loop through collection of actionSets For i = 0 To colNodes.length - 1 Set objNode = colNodes(i) Set colFilters = objNode.selectNodes("filterSet/*") ' If actionSet's filterSet is True, execute actions' ******* BEGIN: Indent reduced to allow for more code ******* If TestConditions(colFilters) Then Set colActions = objNode.selectNodes("actions/*") ' Iterate through each action For j = 0 To colActions.length - 1 Set objAction = colActions(j) Select Case LCase(objAction.nodeName) Case "addprinter" Set obj = New AddPrinter obj.Settings(s) obj.UNC = ReplaceWildCards( _ objAction.getAttribute("unc"), s) obj.Execute() Case "copyfile" Set obj = New CopyFile obj.Settings(s) obj.Source = ReplaceWildCards( _ objAction.getAttribute("source"), s) obj.Destination = ReplaceWildCards( _ objAction.getAttribute("destination"), s) obj.CopyOption = objAction.getAttribute("option") obj.Execute() Case "executeinbackground" Set obj = New RunProgramInBackground obj.Settings(s) obj.Executable = ReplaceWildCards( _ objAction.getAttribute("executable"), s) obj.Execute() Case "executeandwait" Set obj = New RunProgramAndWait obj.Settings(s) obj.Executable = ReplaceWildCards( _ objAction.getAttribute("executable"), s) obj.Execute() Case "mapdrive" Set obj = New MapDrive obj.Settings(s) obj.Drive = ReplaceWildCards( _ objAction.getAttribute("drive"), s) obj.UNC = ReplaceWildCards( _ objAction.getAttribute("unc"), s) obj.Persistent = CBool( _ objAction.getAttribute("persistent") = "true") obj.AltUser = objAction.getAttribute("altUser") obj.AltPass = objAction.getAttribute("altPass") obj.Execute() Case "setdefaultprinter" Set obj = New SetDefaultPrinter obj.Settings(s) obj.UNC = ReplaceWildCards( _ objAction.getAttribute("unc"), s) obj.Execute() End Select Set obj = Nothing Next End If' ******* END: Indent reduced to allow for more code ******* Next ' Clean up memory Set colNodes = Nothing Set objNode = Nothing Set colActions = Nothing Set colFilters = Nothing Set objAction = Nothing Else ' The document failed to load. Dim strErrText, xPE Set xPE = objXMLDoc.parseError With xPE strErrText = "Your XML Document failed to load " & _ "due the following error." & vbCrLf & vbCrLf & _ "Error #: " & .errorCode & ": " & xPE.reason & _ "Line #: " & .Line & VbCrLf & _ "Line Position: " & .linepos & VbCrLf & _ "Position In File: " & .filepos & VbCrLf & _ "Source Text: " & .srcText & VbCrLf & _ "Document URL: " & .url & VbCrLf & VbCrLf & _ "The logon script will not proceed." End With Call s.Debug(strErrText, 0, 1) MsgBox strErrText, vbExclamation ' Clean up used memory Set xPE = Nothing s.objLog.FinalizeLogging(1) End If ' Clean up Set objXMLDoc = Nothing End Sub Private Function TestConditions(ByRef objFilters) Dim objFilter, i ' Initialize test condition TestConditions = True ' Iterate through each filter For i = 0 To objFilters.length - 1 Set objFilter = objFilters(i) ' Test condition Select Case LCase(objFilter.getAttribute("condition")) Case "and" TestConditions = TestConditions And _ TestFilter(objFilter) Case "or" TestConditions = TestConditions Or _ TestFilter(objFilter) Case "not" TestConditions = TestConditions And Not _ TestFilter(objFilter) If Not TestConditions Then Exit For End If End Select Next Set objFilter = Nothing End Function Private Function TestFilter(ByRef objFilter) Dim filterType filterType = objFilter.nodeName If filterType = "filter" Then Select Case LCase(objFilter.getAttr
ibute("type")) Case LCase("userName") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strUserName) Case LCase("userDomain") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strUserDomain) Case LCase("displayName") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strDisplayName) Case LCase("group") TestFilter = IsMember(s.objUser, objFilter. _ getAttribute("name"), s.objGroups) Case LCase("computerName") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strComputerName) Case LCase("computerDomain") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strDomainName) Case LCase("domainController") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strDC) Case LCase("siteName") TestFilter = LCase(objFilter. _ getAttribute("name")) = LCase(s.strSiteName) End Select End If If filterType = "boolFilter" Then Select Case LCase(objFilter.getAttribute("type")) Case LCase("isICASession") TestFilter = s.blnIsICASession Case LCase("isRDPSession") TestFilter = s.blnIsRDPSession Case LCase("isServer") TestFilter = s.blnIsServer Case LCase("is64BitOS") TestFilter = s.blnIs64BitOS End Select End If End FunctionEnd Class'/////////////////////////////////////////////////////////////////////////////'Example #2 is the same code but uses an updated standard which eliminates the use of forced 80-character columns.'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'Class LogonRules' Parse XML for logon rules'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' Private s Private strComputerName, strUserName, m_objGroups, m_objComputer, m_objUser'/////////////////////////////////////////////////////////////////////////////' Public Sub Settings(ByRef objSettings) Set s = objSettings End Sub'/////////////////////////////////////////////////////////////////////////////' Public Sub Execute' Prepare to load the logon rules XML file Dim objXMLDoc Set objXMLDoc = CreateObject("Microsoft.XMLDOM") objXMLDoc.async = "False"' Attempt to load the logon rules XML file Call s.Debug("", 0, 0) Call s.Debug("LogonRules: Loading logon rules/actions XML file...", 0, 0) Call s.Debug("LogonRules: File path:'" & s.strXMLFile & "'.", 1, 0) Dim blnLoadSuccess blnLoadSuccess = objXMLDoc.load(s.strXMLFile) Select Case blnLoadSuccess' SUCCESS: Loaded logon rules XML document Case True Call s.Debug("LogonRules: Successfully loaded XML logon rules/actions file.", 1, 0)' Make a collection containing each actionSet Dim strXPath strXPath = "//logonRules/actionSet" Call s.Debug("LogonRules: Parsing XML logon rules/actions file.", 1, 0) Dim colNodes Set colNodes = objXMLDoc.selectNodes(strXPath)' Iterate through each actionSet Dim i For i = 0 To colNodes.length - 1 Dim objNode Set objNode = colNodes(i) Dim colFilters Set colFilters = objNode.selectNodes("filterSet/*") ' If actionSet's filterSet is True, execute actions If TestConditions(colFilters) Then Dim colActions Set colActions = objNode.selectNodes("actions/*")' Iterate through each action Dim j For j = 0 To colActions.length - 1 Dim objAction, obj Set objAction = colActions(j) Call s.Debug("LogonRules: Action found - '" & objAction.nodeName & "'.", 1, 0) Select Case LCase(objAction.nodeName) Case LCase("addPrinter") Set obj = New AddPrinter obj.Settings(s) obj.UNC = ReplaceWildCards(objAction.getAttribute("unc"), s) obj.Execute() Case LCase("copyFile") Set obj = New CopyFile obj.Settings(s) obj.Source = ReplaceWildCards(objAction.getAttribute("source"), s) obj.Destination = ReplaceWildCards(objAction.getAttribute("destination"), s) obj.CopyOption = objAction.getAttribute("option") obj.Execute() Case LCase("executeInBackground") Set obj = New RunProgramInBackground obj.Settings(s) obj.Executable = ReplaceWildCards(objAction.getAttribute("executable"), s) obj.Execute() Case LCase("executeAndWait") Set obj = New RunProgramAndWait obj.Settings(s) obj.Executable = ReplaceWildCards(objAction.getAttribute("executable"), s) obj.Execute() Case LCase("mapDrive") Set obj = New MapDrive obj.Settings(s) obj.Drive = ReplaceWildCards(objAction.getAttribute("drive"), s) obj.UNC = ReplaceWildCards(objAction.getAttribute("unc"), s) obj.Persistent = CBool(objAction.getAttribute("persistent") = "true") obj.AltUser = objAction.getAttribute("altUser") obj.AltPass = objAction.getAttribute("altPass") obj.Execute() Case LCase("setDefaultPrinter") Set obj = New SetDefaultPrinter obj.Settings(s) obj.UNC = ReplaceWildCards(objAction.getAttribute("unc"), s) obj.Execute() End Select' Cleanup Set obj = Nothing' Process next nodeName Next End If' Process next action Next ' FAIL: Unable to load the XML logon rules file Case False Call s.Debug("ERROR:
Failed to load XML logon rules/actions file.'" & s.strXMLFile & "'.", 0, 1)' Clean up Set objXMLDocParseError = Nothing' Close IE log s.objLog.FinalizeLogging(1) End Select ' Clean up Set colNodes = Nothing Set objNode = Nothing Set colActions = Nothing Set colFilters = Nothing Set objAction = Nothing Set objXMLDoc = Nothing End Sub'/////////////////////////////////////////////////////////////////////////////' Private Function TestConditions(ByRef objFilters)' Initialize test condition TestConditions = True' Iterate through each Filter Dim i, objFilter For i = 0 To objFilters.length - 1 Set objFilter = objFilters(i)' Test condition If objFilter.getAttribute <> "" Then Call s.Debug("TestConditions: Condition found - '" & objFilter.getAttribute & "'.", 1, 0) Select Case LCase(objFilter.getAttribute("condition")) Case LCase("and") TestConditions = TestConditions And TestFilter(objFilter) Case LCase("or") TestConditions = TestConditions Or TestFilter(objFilter) Case LCase("no") TestConditions = TestConditions And Not TestFilter(objFilter) If Not TestConditions Then Exit For End If End Select Next' Clean up Set objFilter = Nothing End Function'/////////////////////////////////////////////////////////////////////////////' Private Function TestFilter(ByRef objFilter) Dim filterType filterType = LCase(objFilter.nodeName) If filterType <> "" Then Call s.Debug("TestFilter: Filter found - '" & filterType & "'.", 1, 0) If filterType = LCase("filter") Then Select Case LCase(objFilter.getAttribute("type")) Case LCase("userName") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strUserName) Case LCase("userDomain") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strUserNetBIOSDomain) Case LCase("displayName") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strUserDisplayName) Case LCase("group") TestFilter = IsMember(LCase(s.objUser), LCase(objFilter.getAttribute("name")), LCase(s.objGroups)) Case LCase("computerName") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strComputerName) Case LCase("computerDomain") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strComputerDNSDomainName) Case LCase("domainController") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strDC) Case LCase("siteName") TestFilter = LCase(objFilter.getAttribute("name")) = LCase(s.strSiteName) End Select End If If filterType = LCase("boolFilter") Then Select Case LCase(objFilter.getAttribute("type")) Case LCase("isICASession") TestFilter = s.blnIsICASession Case LCase("isRDPSession") TestFilter = s.blnIsRDPSession Case LCase("isServer") TestFilter = s.blnIsServer Case LCase("is64BitOS") TestFilter = s.blnIs64BitOS End Select End If End Function'/////////////////////////////////////////////////////////////////////////////'End Class'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'In the end, it's about options. Word wrap gives us more of them.Ken K.2009-10-09 17:37:24
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Feature request: word wrap

Post by Alexander Riedel »

I really would have no preference to either version, admittedly version two seems more aligned with how I would write it. However, both display fine without the need for any scrolling on my computer, even on the 12" notebook screen, and word wrap wouldn't even kick in.

I guess I would like to see a screenshot in Notepad++ how you look at the code word wrapped to be able to imagine what it feels like for you.

Can you size this particular example in Notepad++ and scroll to the point where you look at it and say this is what I am talking about? Then make a screenshot?
If it's to big to attach it here, feel free to email it to support@sapien.com

Thanks.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 14 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked