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 785213 - Hitting Enter in php files inserts more than one new line
Hitting Enter in php files inserts more than one new line
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-21 08:53 UTC by Guillaume Pasquet
Modified: 2017-07-21 09:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
indenter: only copy indent up to line end (1.21 KB, patch)
2017-07-21 09:18 UTC, Christian Hergert
committed Details | Review

Description Guillaume Pasquet 2017-07-21 08:53:50 UTC
When editing a PHP file, hitting enter anywhere in the file inserts more than one new line. I've seen the number of new lines inserted ranging from 1 to 4 after pressing Enter just once.

I've also tried when editing some Python code, and then this behaviour doesn't happen.
Comment 1 Christian Hergert 2017-07-21 09:18:38 UTC
Created attachment 356097 [details] [review]
indenter: only copy indent up to line end

When we do not have an indenter, we try to copy the indentation
style of gedit. We simply copy the previous line. However, we
were copying too much information by not stoping at the line
end.

This caused multiple newline insertions matching up to the
number of new lines after the insertion cursor (plus the newline
we added).
Comment 2 Christian Hergert 2017-07-21 09:21:23 UTC
Thanks for the excellent bug report. I knew the culprit almost immediately
upon reading the summary.

Fixed in master, but I think the nightly build server is down right now due
to mozjs52 breaking. So it might be a little bit before the next nightly
gets out.

Attachment 356097 [details] pushed as 7e65f03 - indenter: only copy indent up to line end
Comment 3 Guillaume Pasquet 2017-07-21 09:29:27 UTC
Thanks a lot for the fix Christian!