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 756705 - editor silently strips form feed characters
editor silently strips form feed characters
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-16 16:44 UTC by Andrew Stubbs
Modified: 2015-10-16 19:47 UTC
See Also:
GNOME target: ---
GNOME version: 3.17/3.18



Description Andrew Stubbs 2015-10-16 16:44:31 UTC
If an input file contains a form feed (ASCII 12, '\f', '^L') then it will be silently stripped on save.

For example, these are not uncommon in GNU projects (grepping the binutils/GDB source repo shows 3567, not including the testsuites), and removing them randomly is surely frowned upon.

Vim, and Emacs display them as "^L". Sublime text has an "FF" glyph-sort-of-thing. All of them leave the character in when saving.

Regardless of how they are displayed, or whether this sort of thing serves any purpose any more, Gnome Builder should not be silently modifying anything in the file, white-space or not.
Comment 1 Christian Hergert 2015-10-16 16:57:12 UTC
Builder itself strips trailing whitespace only from lines that are modified as recognized by the version control system (only git currently).

Are you seeing them stripped from lines that were not edited? If so, that would be a bug in GtkSourceView that we should address there.
Comment 2 Christian Hergert 2015-10-16 17:01:59 UTC
I should also note that you can disable trimming of trailing whitespace in the preferences, on a per-language basis.

Preferences can be activated from the application menu, or ctrl+comma keyboard shortcut. Go to the "Programming Languages" section, and then select your target language, such as "C". You'll then see an option named "Trim trailing whitespace when saving document".
Comment 3 Christian Hergert 2015-10-16 18:03:27 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.

We no longer use g_unichar_isspace() to detect whitespace and instead only trim space (' ') or horizontal tab ('\t'). See commit eea3027a4db73fd123864e14d569f7dd4ce82861 for the fix.
Comment 4 Christian Hergert 2015-10-16 19:47:37 UTC
Oops, I broke trimming with that. Fixed with commit 4298a6b03b77730c4133d0b54048e0e12ed88027.