English 中文(简体)
Gedit adds line at end of file
原标题:

The answer to this must be somewhere but I m not finding it -- can anyone help me understand why in Gedit, if I have a page of code there is no extra trailing blank line, but then when I do a file comparison for my svn commit it shows an extra line being added at the end of the file?

I have a feeling that Gedit is automatically adding an ending line break. But why, I have no idea...

最佳回答

Reality finally won and it s been fixed, but the broken behavior is still the default; enable the WYSIWYG behavior in a terminal with

gsettings set org.gnome.gedit.preferences.editor ensure-trailing-newline false
问题回答

It s a feature. I don t think it can easily be disabled.

this is intentional: text files should always be terminated by , otherwise tools like cat , sed etc may have problems. However there is no reason to always show an empty line at the bottom of the text view, that s why we do not show the last

paolo borelli [gedit developer]

Some editors (I m unfamiliar with Gedit specifically) will try to ensure that a file always ends with a newline character. Other editors, like perhaps the one that you originally created the file with, will allow you to end a file without a final newline character.

Try the Whitespace Remover plugin.





相关问题
messy css indentation in vim

When editing an html file in vim, the indentation for css inside style tags is messy. For instance, this is how it would indent this sample css code without any manual intervention to fix the ...

WYSIWYM editor for desktop (.NET/WinForms)

What can I use as WYSIWYM editor for desktop application (preferably .NET/WinForms)? I need functions as paragraphs, headings 1, 2, 3, (un)ordered lists, strong and no other formating (restrictive). ...

Working free text-editor for windows 7

Does anyone have a free text-editor that works well in Windows 7? I m currently useing Programmer s Notpad 2, but it keeps crashing or having UI bug issues. LIST TextPad NOTEPAD++ GNU Emacs Zeus ...

setTabChangesFocus(bool) has no effect Qt

I need to forbid the tab input in a QPlainTextEdit widget. Instead tab should be used has a "focus next" widget. It seems that setTabChangesFocus(bool) is made for that but setting it to true has no ...

What do you use to write Go [closed]

I know its a bit too early, but I ve been trying out Go (Google s Programming Language) and its kindof annoying to write code in gedit. So, my question: What do you use to experiment with Go?

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签