Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] "New line at end of file when saving" as project preference

What does everyone think about changing the default?  If that's what the
ANSI and ISO standards mandate maybe we should have it on by default.

This would be a very simple one line change on
org.eclipse.cdt.ui.PreferenceConstants.initializeDefaultValues(IPreferenceStore):

      store.setDefault(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, true);
                           
                           
 Gabriel Castro            
 Software Engineer         
 IBM Ottawa Lab            
 (613) 726-5548            
 gabriel_castro@xxxxxxxxxx 
                           





|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |wieant@xxxxxxxxx (Wieant Nielander)                                                                                                               |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |"CDT General developers list." <cdt-dev@xxxxxxxxxxx>                                                                                              |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |09/04/2008 10:27 AM                                                                                                                               |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [cdt-dev] "New line at end of file when saving" as project    preference                                                                      |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





>> BTW, My vote is to not make this the default. I hate editors mucking
>> with my files. Some compilers deal with no new line at the end just fine
>> (gcc just raises a warning).

> I agree with you that it probably shouldn't be the default.  That's why I
> figured a project specific preference would be the best way to go.
>
> Raised it as a enhancement request against CDT-UI:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=226285

In my opinion it should be the default, according to the ansi standard
a non-empty file shall end in a new-line character, so by not
generating it you actually end up with an invalid file. On source
files you will indeed generally only get a warning, but include files not
having a newline at the end may cause more obscure preprocessing issues.
Another major argument is that vi also automatically generates a
newline at the end-of-file...

Regards,
  Wieant
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top