GNOME Bugzilla – Bug 658891
gedit doesn't display an empty last line
Last modified: 2011-09-13 17:32:45 UTC
1) Create a file in a terminal: $ echo a > test.txt The command `echo` automatically adds an newline, so the file size is 2 bytes: $ stat -c %s test.txt 2 $ cat test.txt a $ See the newline displayed by `cat` after the character "a". 2) Open "test.txt" with gedit. Actual result: gedit displays only 1 line: 1 a Expected result: gedit should display 2 lines: 1 a 2 Note that the editors Geany and Leafpad display 2 lines.
May be related to bug 658890
*** Bug 658890 has been marked as a duplicate of this bug. ***
I'm pretty sure this is also a dup but I can't find the bug. Anyway this behavior is on purpose. The reason for this is that without it apps like cat would break. Other text editors do this too so it is the less problematic way to deal with this.
(In reply to comment #3) > I'm pretty sure this is also a dup but I can't find the bug. I think you refer to bug 324942 gedit automatically adds an empty last line (to don't have problem with some command line tools), so it doesn't display it because even if the user removes it, the empty last line will be added again when saving. I understand why gedit behaves like this, even if I don't feel very comfortable with the fact that gedit hides me something. IMHO, if there's an empty last line, gedit should display it, because it's part of the content. Regards. *** This bug has been marked as a duplicate of bug 324942 ***