GNOME Bugzilla – Bug 689621
External tool "Remove trailing spaces" removes last line
Last modified: 2019-03-23 20:56:41 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.
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.
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.
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.