AutoLispExt icon indicating copy to clipboard operation
AutoLispExt copied to clipboard

Trailing whitespaces are getting added where they're not

Open stephen147 opened this issue 3 years ago • 5 comments

Describe the bug Trailing whitespaces are getting added when there were none.

To Reproduce Paste this code to the editor, there's whitespaces getting added after (errmsg) and errmsg .

  (defun *error* (errmsg) 
    (and acDoc (vla-EndUndoMark acDoc))
    (and errmsg 
         (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*"))
         (princ (strcat "\n<< Error: " errmsg " >>\n"))
    )
  )

Expected behaviour It shouldn't be adding in trailing whitespaces when there were none.

Desktop (please complete the following information):

  • OS: Microsoft Windows 10 Pro

Additional context I have trim trailing whitespace set in VSCodes settings but this doesn't have any effect on this.

stephen147 avatar Jul 10 '22 14:07 stephen147

Hi @stephen147 , I can't reproduce this problem. This is the result after I pasted the code into VS Code: image

I then right-clicked in the editor, and clicked 'Format Document', and the result seems good too: image

I then tried to add a whitespace - changing (errmsg) to (errmsg ), and then ran 'Format Document', and that whitespace I added was removed.

I'm working with AutoLispExt v1.5.0. And I guess there's sth. else altering the text... image

Sen-real avatar Jul 11 '22 09:07 Sen-real

Thanks for looking into this. My vscode install is fairly fresh. I'll unzip and new install and install this extension and see if the problem occurs.

stephen147 avatar Jul 11 '22 12:07 stephen147

I've disabled all extensions except AutoLispExt and updated to pre release version v1.5.1.

Still the same issue.

Anything else I could try as well as disabling the extensions.

stephen147 avatar Jul 20 '22 21:07 stephen147

I can confirm this, after formatting the text, each command/function that is split into multiple lines is geting a trailing space:

Before format: image

After formatting: image

vanowm avatar May 09 '24 00:05 vanowm

The trailing spaces are added during formatting (SHIFT + ALT + F)

vanowm avatar Aug 28 '24 17:08 vanowm