/build/static/layout/Breadcrumb_cap_w.png

How to stop ASE from inserting spaces in pasted code

The scripting suite Admin Script Editor (ASE) includes a Script Formatter feature that can be problematic at times. Well intentioned, the feature aims to automatically clean up code, doing things such as:

  • automatically indenting
  • automatically inserting spaces
  • automatically formatting completed function blocks
  • deleting trailing whitespace
  • automatically formatting completed statements on enter

When you are typing code the feature is normally quite welcome, but when pasting code its attempt to run so many rules against what is being pasted can result in unwanted spaces and that can be frustrating. To address this, the latest version of ASE now ships with the option to formate code when pasted disabled. However, settings are not overwritten if a previous version of ASE is present. If you have an existing installation and run into this problem, it is easy to adjust this feature yourself:

From Tools > Options, choose "Script Code" under the Formatting options. 

Here you can quickly disable the feature entirely by deselecting, "Enable script code formatting". However, this is a cool feature you probably don't want to drop alltogether, so I recommend clicking the "Launch Script Formatter" button and for each language you care about, deselect the "Adjust indention on paste" option (General).

If you'd like to really dig into this powerful feature, check out the indentation, spacing and wrapping options for each language. You can turn on and off very specific options and even see examples of their impact as you make your choices.


Comments

  • I'm reminded by one reader that If you use the Right-Click/Advanced/Format Entire Script option, you will also see this same behavior (as when pasting code into ASE). - bkelly 11 years ago
  • Hi. In v3.5, when using FORMAT ENTIRE SCRIPT, there was an undesireable space inserted after the "&" when defining a color as "&H000000" (VBScript, vb hex code color). I learned to watch for that and didn't worry much. BUT, in v4 (VBScript) there is a space inserted after the "I" in all "IF" statements; VERY destructive bug. any tip on where I can stop that behavior?? (win8 64bit, with options for spaces all turned off) - BBarker 9 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ