After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689621 - External tool "Remove trailing spaces" removes last line
External tool "Remove trailing spaces" removes last line
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
3.6.x
Other Linux
: Normal major
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-04 13:25 UTC by Rodrigo Dias Cruz
Modified: 2019-03-23 20:56 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6


Attachments
Exception that is raised whenever the problem occurs (640 bytes, text/plain)
2012-12-04 13:29 UTC, Rodrigo Dias Cruz
  Details
Patch that can fix the problem (1.75 KB, patch)
2012-12-04 13:52 UTC, Rodrigo Dias Cruz
none Details | Review

Description Rodrigo Dias Cruz 2012-12-04 13:25:43 UTC
The problem is in the "External tools" plugin.

The tool "Remove trailing spaces" works well except for the fact that it removes not only trailing spaces, but also the last line of documents in some cases.

The problem happens on documents whose last line contain any non-blank character. If the last line contains only blank characters, the problem does not occur.

How to reproduce:

1. Enable the plugin "External tools" in Gedit preferences
2. Open a file whose last line is *not* blank
3. Run the external tool "Remove trailing spaces" (Alt+F12)
4. ERROR: the last line of the document has been removed

Thanks.
Comment 1 Rodrigo Dias Cruz 2012-12-04 13:29:23 UTC
Created attachment 230654 [details]
Exception that is raised whenever the problem occurs

Additional information: whenever the problem occurs, the exception in the attached file is raised by gedit.
Comment 2 Rodrigo Dias Cruz 2012-12-04 13:52:12 UTC
Created attachment 230655 [details] [review]
Patch that can fix the problem

This patch can fix the problem.

The idea was first proposed by "Sabina Jung" at
https://bugs.launchpad.net/ubuntu/+source/gedit-plugins/+bug/995747/comments/7
then applied, tested and confirmed by myself.
Comment 3 Jeremy Bicha 2013-06-26 21:52:15 UTC
Thank you for reporting this bug.

I was not able to duplicate this bug with gedit 3.8.3 and the patch no longer applies. Therefore I'm closing this bug.