Author Topic: 27.0.x.y: Unreliable "Strip trailing spaces only from modified lines"  (Read 435 times)

os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
I work on a project (mostly C/C++) where the builds will fail if code is committed with trailing spaces on any line in most source files.  The exception are some 3rd party libraries, which unfortunately are less strict and have trailing spaces in their sources.  So, it is not possible to use the "Strip all trailing spaces" file option, but must settle for "Strip trailing spaces only from modified lines" instead.

After upgrading to 27.0, SlickEdit somehow has introduced trailing spaces in doxygen/javadoc style comments a number of times.  It seems to be a bit of a heisenbug, though, as it isn't always reproducible. However, here is a scenario that seems to work reliably:
1. svn cat https://www.virtualbox.org/svn/vbox/trunk/include/iprt/http.h > /tmp/http-strip-spaces-issue.h
2. vs +new -sc /tmp/slickcfg-1 /tmp/http-strip-spaces-issue.h
3. Opening Document -> C/C++ Options, go the the File Options and change the stripping options to from "Default" to "Strip trailing spaces only from modified lines".
4. Place the cursor at the end of line 63 (comment line saying Creates a HTTP client instance.).
5. Hit the return (or enter) key.
6. The cursor is now standing in column 4 on the new line 64, with an asterisk in column 2.
7. Save (Ctrl-S)

The result here is always that line 63 now has an extra space at the end and line 64 has two trailing spaces.  Seems there is more than just ignoring the stripping-on-save options going on here.

-bird

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6589
  • Hero Points: 511
Thanks for the precise example. The bug has to do with outlining and editor functions like insert_line() and _insert_text() not working correctly. Save works fine but only if the line flags are set correctly. The line flags are bad before you save the file.

This is not hot fixable. I can build some fix installers. What platform(s) are you using?

os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
Thanks for the quick response.

I'm on x64 Linux and x64 Windows at the moment.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3913
  • Hero Points: 513
I can hot fix the specific issue with comment editing (line split) leaving an extra trailing space on line 63.  Clark's fix is certainly the more complete solution.


os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
The linux build (qt4) works great. Been using it for a two days now and haven't committed any trailing white space yet.

Thanks!