Author Topic: 21.0.2: Delete trailing whitespace bug when pasting?  (Read 1169 times)

davew

  • Senior Community Member
  • Posts: 224
  • Hero Points: 6
21.0.2: Delete trailing whitespace bug when pasting?
« on: May 22, 2017, 06:44:52 pm »
I copied some code that had trailing whitespace and pasted it into a file. When saving the trailing whitespace is not removed. If I manually type whitespace at the end of a line or on a line by itself, it is removed when saving, so it seems to only be affected when pasting. I was suspecting that there might be some non-space characters at the ends, but that is not the case. I am attaching a document with an image that shows my setting and the hex mode for a line in the file that has trailing whitespace.

Interestingly, I tried typing a line with trailing whitespace in a file, copying the line and pasting in another file, and then saving the file in which it was pasted, but the trailing whitespace was deleted.

I can provide the problem file privately if needed.

I am using 21.0.2 with cummulative hotfix 13.
« Last Edit: May 22, 2017, 07:16:40 pm by davew »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2834
  • Hero Points: 429
Re: 21.0.2: Delete trailing whitespace bug when pasting?
« Reply #1 on: May 22, 2017, 08:12:10 pm »
When you checked for trailing non-space chars, did you also look for CR (ascii 13).  You could get those if you had a file with Unix line endings and pasted in text with DOS line endings.

davew

  • Senior Community Member
  • Posts: 224
  • Hero Points: 6
Re: 21.0.2: Delete trailing whitespace bug when pasting?
« Reply #2 on: May 23, 2017, 02:07:47 pm »
The whole file has CRLF (0x0D0x0A). But even if there were a mix, I would think that it wouldn't matter if the line ended in an LF or CRLF, if there are whitespace characters preceding the line ending, they should be removed.