GNOME Bugzilla – Bug 785213
Hitting Enter in php files inserts more than one new line
Last modified: 2017-07-21 09:29:27 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.
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).
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
Thanks a lot for the fix Christian!