Loading ...
Sorry, an error occurred while loading the content.

Automatic / Manual (By Button or Menu Item) Code Spacing / Formatting?

Expand Messages
  • lil_ghandi_burk
    Hi everyone! Hope you re Monday isn t too rough... I have a question about copied (or imported / opened) code that tends to be out-of-line with general
    Message 1 of 5 , Jul 11, 2011
    • 0 Attachment
      Hi everyone! Hope you're Monday isn't too rough...

      I have a question about copied (or imported / opened) code that tends to be out-of-line with general spacing, tab characters, etc.

      I just highlighted some code from a tutorial I was following and pasted it into EditPlus only to frustratingly discover that it is now completely truncated of space, tabs, and in some occasions, carriage / linefeed due to having removed 1 space character somewhere...

      What a pain!

      So now I have to spend about 10 or 15 minutes restructuring the code, making sure it's properly spaced, ensuring that no IF-ELSE or FUNCTION calls have been broken, etc. This can have dire consequences for someone just beginning to learn a new language, implementing a foreign feature...

      So I'm curious: do any time-tested and community-approved solutions exist for EditPlus that can format code with a click of a button or selection of a menu item?

      I often use Microsoft Visual Studio 2010 Express's "Format Code" for this sole purpose and while it effectively re-aligns and tabs everything out the way it's needed, this is a very inconvenient way to work as it not only takes a few seconds to load, but takes a considerable amount of memory for no other reason than realignment of code braces!

      Does EditPlus 3+ have any available user tools to handle this kind of hair-pulling problem I'm fist-fighting or am I stuck with loading up a program that consumes at least 500k for no other reason than to align IF-ELSE blocks?

      Any insight into this is deeply appreciated as always. And just so you know, I've tried a couple of the user tools that are floating around the user tool pages to no avail. Adding them was easy, but unfortunately, the ones I tried just never seemed to work.
    • mljones1947
      Try these links: http://editplus.info/wiki/User_Tools#Fix_Code_Spacing http://editplus.info/wiki/User_Tools#Fix_Code_Indentation I haven t used them myself.
      Message 2 of 5 , Jul 12, 2011
      • 0 Attachment
        Try these links:

        http://editplus.info/wiki/User_Tools#Fix_Code_Spacing

        http://editplus.info/wiki/User_Tools#Fix_Code_Indentation

        I haven't used them myself.

        --- In editplus@yahoogroups.com, "lil_ghandi_burk" <lil_ghandi_burk@...> wrote:
        >
        > Hi everyone! Hope you're Monday isn't too rough...
        >
        > I have a question about copied (or imported / opened) code that tends to be out-of-line with general spacing, tab characters, etc.
        >
        > I just highlighted some code from a tutorial I was following and pasted it into EditPlus only to frustratingly discover that it is now completely truncated of space, tabs, and in some occasions, carriage / linefeed due to having removed 1 space character somewhere...
        >
        > What a pain!
        >
        > So now I have to spend about 10 or 15 minutes restructuring the code, making sure it's properly spaced, ensuring that no IF-ELSE or FUNCTION calls have been broken, etc. This can have dire consequences for someone just beginning to learn a new language, implementing a foreign feature...
        >
        > So I'm curious: do any time-tested and community-approved solutions exist for EditPlus that can format code with a click of a button or selection of a menu item?
        >
        > I often use Microsoft Visual Studio 2010 Express's "Format Code" for this sole purpose and while it effectively re-aligns and tabs everything out the way it's needed, this is a very inconvenient way to work as it not only takes a few seconds to load, but takes a considerable amount of memory for no other reason than realignment of code braces!
        >
        > Does EditPlus 3+ have any available user tools to handle this kind of hair-pulling problem I'm fist-fighting or am I stuck with loading up a program that consumes at least 500k for no other reason than to align IF-ELSE blocks?
        >
        > Any insight into this is deeply appreciated as always. And just so you know, I've tried a couple of the user tools that are floating around the user tool pages to no avail. Adding them was easy, but unfortunately, the ones I tried just never seemed to work.
        >
      • Casey Joseph Burk
        Thanks, mljones1947. Maybe I m doing something wrong here but I ve tried those before to no avail, but here s what I ve done (maybe you might see a mistake
        Message 3 of 5 , Jul 13, 2011
        • 0 Attachment
          Thanks, mljones1947. Maybe I'm doing something wrong here but I've tried those before to no avail, but here's what I've done (maybe you might see a mistake somewhere with how I installed everything):

          1.) Copied and pasted the JavaScript on those pages and created the JavaScript file to be used and referenced from within the C:\Program Files\EditPlus3\addons directory. I didn't change the JavaScript extension into anything else. Was I supposed to? The "Select File" window you use to find the Command file for User Tools seems to want to find executable files...

          2.) After I found and set the JavaScript file path, I then prepended the rest of the command Mark Kahn used with his command (i.e. - cscript //NoLogo) and enclosed the path inside double-quotes.

          3.) Finally, I checked the option for "Run as text filter:" and pressed "Apply".

          After doing all this, I then loaded up a random XML file to use this tool with. It didn't work...

          I'm using EditPlus 3.21 for whatever it's worth. I wish I could get this to work...

          Regards,

          Casey Joseph Burk

          www.caseyburk.com

          --- On Wed, 7/13/11, mljones1947 <mljones1947@...> wrote:

          From: mljones1947 <mljones1947@...>
          Subject: [edit+] Re: Automatic / Manual (By Button or Menu Item) Code Spacing / Formatting?
          To: editplus@yahoogroups.com
          Date: Wednesday, July 13, 2011, 12:02 AM







           













          Try these links:



          http://editplus.info/wiki/User_Tools#Fix_Code_Spacing



          http://editplus.info/wiki/User_Tools#Fix_Code_Indentation



          I haven't used them myself.



          --- In editplus@yahoogroups.com, "lil_ghandi_burk" <lil_ghandi_burk@...> wrote:

          >

          > Hi everyone! Hope you're Monday isn't too rough...

          >

          > I have a question about copied (or imported / opened) code that tends to be out-of-line with general spacing, tab characters, etc.

          >

          > I just highlighted some code from a tutorial I was following and pasted it into EditPlus only to frustratingly discover that it is now completely truncated of space, tabs, and in some occasions, carriage / linefeed due to having removed 1 space character somewhere...

          >

          > What a pain!

          >

          > So now I have to spend about 10 or 15 minutes restructuring the code, making sure it's properly spaced, ensuring that no IF-ELSE or FUNCTION calls have been broken, etc. This can have dire consequences for someone just beginning to learn a new language, implementing a foreign feature...

          >

          > So I'm curious: do any time-tested and community-approved solutions exist for EditPlus that can format code with a click of a button or selection of a menu item?

          >

          > I often use Microsoft Visual Studio 2010 Express's "Format Code" for this sole purpose and while it effectively re-aligns and tabs everything out the way it's needed, this is a very inconvenient way to work as it not only takes a few seconds to load, but takes a considerable amount of memory for no other reason than realignment of code braces!

          >

          > Does EditPlus 3+ have any available user tools to handle this kind of hair-pulling problem I'm fist-fighting or am I stuck with loading up a program that consumes at least 500k for no other reason than to align IF-ELSE blocks?

          >

          > Any insight into this is deeply appreciated as always. And just so you know, I've tried a couple of the user tools that are floating around the user tool pages to no avail. Adding them was easy, but unfortunately, the ones I tried just never seemed to work.

          >






















          [Non-text portions of this message have been removed]
        • mljones1947
          I tried both examples, and they worked for me. 1. Copied and pasted code into two files, FixCodeIndention.js and FixCodeSpacing.js in the folder C: Temp 2.
          Message 4 of 5 , Jul 14, 2011
          • 0 Attachment
            I tried both examples, and they worked for me.

            1. Copied and pasted code into two files, FixCodeIndention.js and FixCodeSpacing.js in the folder C:\Temp

            2. Created two new user tools (programs) with appropriate Menu text and the commands

            cscript //NoLogo "c:\temp\FixCodeIndention.js"

            cscript //NoLogo "c:\temp\FixCodeSpacing.js"

            Argument and Initial directory are empty, Action is Run as Text Filter (Replace), and Save is None

            --- In editplus@yahoogroups.com, Casey Joseph Burk <lil_ghandi_burk@...> wrote:
            >
            > Thanks, mljones1947. Maybe I'm doing something wrong here but I've tried those before to no avail, but here's what I've done (maybe you might see a mistake somewhere with how I installed everything):
            >
            > 1.) Copied and pasted the JavaScript on those pages and created the JavaScript file to be used and referenced from within the C:\Program Files\EditPlus3\addons directory. I didn't change the JavaScript extension into anything else. Was I supposed to? The "Select File" window you use to find the Command file for User Tools seems to want to find executable files...
            >
            > 2.) After I found and set the JavaScript file path, I then prepended the rest of the command Mark Kahn used with his command (i.e. - cscript //NoLogo) and enclosed the path inside double-quotes.
            >
            > 3.) Finally, I checked the option for "Run as text filter:" and pressed "Apply".
            >
            > After doing all this, I then loaded up a random XML file to use this tool with. It didn't work...
            >
            > I'm using EditPlus 3.21 for whatever it's worth. I wish I could get this to work...
            >
            > Regards,
            >
            > Casey Joseph Burk
            >
            > www.caseyburk.com
            >
            > --- On Wed, 7/13/11, mljones1947 <mljones1947@...> wrote:
            >
            > From: mljones1947 <mljones1947@...>
            > Subject: [edit+] Re: Automatic / Manual (By Button or Menu Item) Code Spacing / Formatting?
            > To: editplus@yahoogroups.com
            > Date: Wednesday, July 13, 2011, 12:02 AM
            >
            > Try these links:
            >
            >
            > http://editplus.info/wiki/User_Tools#Fix_Code_Spacing
            >
            > http://editplus.info/wiki/User_Tools#Fix_Code_Indentation
            >
            > I haven't used them myself.
            >
            > --- In editplus@yahoogroups.com, "lil_ghandi_burk" <lil_ghandi_burk@> wrote:
            >
            > >
            >
            > > Hi everyone! Hope you're Monday isn't too rough...
            >
            > >
            >
            > > I have a question about copied (or imported / opened) code that tends to be out-of-line with general spacing, tab characters, etc.
            >
            > >
            >
            > > I just highlighted some code from a tutorial I was following and pasted it into EditPlus only to frustratingly discover that it is now completely truncated of space, tabs, and in some occasions, carriage / linefeed due to having removed 1 space character somewhere...
            >
            > >
            >
            > > What a pain!
            >
            > >
            >
            > > So now I have to spend about 10 or 15 minutes restructuring the code, making sure it's properly spaced, ensuring that no IF-ELSE or FUNCTION calls have been broken, etc. This can have dire consequences for someone just beginning to learn a new language, implementing a foreign feature...
            >
            > >
            >
            > > So I'm curious: do any time-tested and community-approved solutions exist for EditPlus that can format code with a click of a button or selection of a menu item?
            >
            > >
            >
            > > I often use Microsoft Visual Studio 2010 Express's "Format Code" for this sole purpose and while it effectively re-aligns and tabs everything out the way it's needed, this is a very inconvenient way to work as it not only takes a few seconds to load, but takes a considerable amount of memory for no other reason than realignment of code braces!
            >
            > >
            >
            > > Does EditPlus 3+ have any available user tools to handle this kind of hair-pulling problem I'm fist-fighting or am I stuck with loading up a program that consumes at least 500k for no other reason than to align IF-ELSE blocks?
            >
            > >
            >
            > > Any insight into this is deeply appreciated as always. And just so you know, I've tried a couple of the user tools that are floating around the user tool pages to no avail. Adding them was easy, but unfortunately, the ones I tried just never seemed to work.
            >
          • Casey Joseph Burk
            Thank you! It s working now! Excellent! Not sure what I did differently here, but I do sincerely appreciate your help with this. Oh man, I m ecstatic! :.)
            Message 5 of 5 , Jul 14, 2011
            • 0 Attachment
              Thank you! It's working now!

              Excellent! Not sure what I did differently here, but I do sincerely appreciate your help with this. Oh man, I'm ecstatic! :.)

              Regards,

              Casey Joseph Burk

              www.caseyburk.com

              --- On Thu, 7/14/11, mljones1947 <mljones1947@...> wrote:

              From: mljones1947 <mljones1947@...>
              Subject: [edit+] Re: Automatic / Manual (By Button or Menu Item) Code Spacing / Formatting?
              To: editplus@yahoogroups.com
              Date: Thursday, July 14, 2011, 9:02 PM







               













              I tried both examples, and they worked for me.



              1. Copied and pasted code into two files, FixCodeIndention.js and FixCodeSpacing.js in the folder C:\Temp



              2. Created two new user tools (programs) with appropriate Menu text and the commands



              cscript //NoLogo "c:\temp\FixCodeIndention.js"



              cscript //NoLogo "c:\temp\FixCodeSpacing.js"



              Argument and Initial directory are empty, Action is Run as Text Filter (Replace), and Save is None



              --- In editplus@yahoogroups.com, Casey Joseph Burk <lil_ghandi_burk@...> wrote:

              >

              > Thanks, mljones1947. Maybe I'm doing something wrong here but I've tried those before to no avail, but here's what I've done (maybe you might see a mistake somewhere with how I installed everything):

              >

              > 1.) Copied and pasted the JavaScript on those pages and created the JavaScript file to be used and referenced from within the C:\Program Files\EditPlus3\addons directory. I didn't change the JavaScript extension into anything else. Was I supposed to? The "Select File" window you use to find the Command file for User Tools seems to want to find executable files...

              >

              > 2.) After I found and set the JavaScript file path, I then prepended the rest of the command Mark Kahn used with his command (i.e. - cscript //NoLogo) and enclosed the path inside double-quotes.

              >

              > 3.) Finally, I checked the option for "Run as text filter:" and pressed "Apply".

              >

              > After doing all this, I then loaded up a random XML file to use this tool with. It didn't work...

              >

              > I'm using EditPlus 3.21 for whatever it's worth. I wish I could get this to work...

              >

              > Regards,

              >

              > Casey Joseph Burk

              >

              > www.caseyburk.com

              >

              > --- On Wed, 7/13/11, mljones1947 <mljones1947@...> wrote:

              >

              > From: mljones1947 <mljones1947@...>

              > Subject: [edit+] Re: Automatic / Manual (By Button or Menu Item) Code Spacing / Formatting?

              > To: editplus@yahoogroups.com

              > Date: Wednesday, July 13, 2011, 12:02 AM

              >

              > Try these links:

              >

              >

              > http://editplus.info/wiki/User_Tools#Fix_Code_Spacing

              >

              > http://editplus.info/wiki/User_Tools#Fix_Code_Indentation

              >

              > I haven't used them myself.

              >

              > --- In editplus@yahoogroups.com, "lil_ghandi_burk" <lil_ghandi_burk@> wrote:

              >

              > >

              >

              > > Hi everyone! Hope you're Monday isn't too rough...

              >

              > >

              >

              > > I have a question about copied (or imported / opened) code that tends to be out-of-line with general spacing, tab characters, etc.

              >

              > >

              >

              > > I just highlighted some code from a tutorial I was following and pasted it into EditPlus only to frustratingly discover that it is now completely truncated of space, tabs, and in some occasions, carriage / linefeed due to having removed 1 space character somewhere...

              >

              > >

              >

              > > What a pain!

              >

              > >

              >

              > > So now I have to spend about 10 or 15 minutes restructuring the code, making sure it's properly spaced, ensuring that no IF-ELSE or FUNCTION calls have been broken, etc. This can have dire consequences for someone just beginning to learn a new language, implementing a foreign feature...

              >

              > >

              >

              > > So I'm curious: do any time-tested and community-approved solutions exist for EditPlus that can format code with a click of a button or selection of a menu item?

              >

              > >

              >

              > > I often use Microsoft Visual Studio 2010 Express's "Format Code" for this sole purpose and while it effectively re-aligns and tabs everything out the way it's needed, this is a very inconvenient way to work as it not only takes a few seconds to load, but takes a considerable amount of memory for no other reason than realignment of code braces!

              >

              > >

              >

              > > Does EditPlus 3+ have any available user tools to handle this kind of hair-pulling problem I'm fist-fighting or am I stuck with loading up a program that consumes at least 500k for no other reason than to align IF-ELSE blocks?

              >

              > >

              >

              > > Any insight into this is deeply appreciated as always. And just so you know, I've tried a couple of the user tools that are floating around the user tool pages to no avail. Adding them was easy, but unfortunately, the ones I tried just never seemed to work.

              >






















              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.