Preserve Existing Line Breaks

AutoCAD AutoLISP & Visual LISP

 
Preserve Existing Line Breaks
 
 
 

When the Preserve Existing Line Breaks option is on, the VLISP formatter inserts new lines whenever a new line is detected in the text it is formatting. When the option is off, the formatter can squeeze a multiple-line expression to the Plane style, if it fits within the right margin.

The following example shows how the Preserve Existing Line Breaks option works.

Initial text:

(if (/= s "Function canceled")   (princ (strcat 
    "\nError: "
      s)) ;single semicolon cmt
) 

Formatting result if the option is on (default):

(if (/= s "Function canceled")
  (princ (strcat
           "\nError: "
           s
         )
  )                                ;single semicolon cmt
)

Formatting result when the option is off:

(if (/= s "Function canceled")
  (princ (strcat "\nError: " s))    ;single semicolon cmt
) 

Note that multiple-line princ and strcat expressions are compressed to a single line.