[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2020-02-13 Thread Edgar Bonet
To those who think the default behavior is a "deficiency" or a "bad
design decision": it is neither. It is the only correct behavior when
dealing with text files. It is not a matter of "simple" vs. "complex"
editors either: it is a matter of Windows vs. Unix text format.

In the Windows world, text files use CRLF as line _separators_. In the
Unix world, text files use LF (newline) as line _terminators_. This is
an important distinction, and it implies that a text file _must_ end
with a newline character. Otherwise it's not a valid text file. 

See "Why should text files end with a newline?":
https://stackoverflow.com/questions/729692

The argument about this causing problems with PHP is moot. PHP accepts
"?>\n" as a valid end-of-code delimiter: it doesn't output the final
"\n". Proof:

$ echo '' > foo.php
$ hd foo.php# Notice the final 0a = LF
  3c 3f 70 68 70 20 65 63  68 6f 20 22 66 6f 6f 22  |.|
0015
$ php foo.php | hd  # Notice the _lack_ of final LF
  66 6f 6f  |foo|
0003
$ 

Note also that in vim you can save a file with no final newline, but for
this you have to enable "binary" mode, which makes sense because the
file you are saving is no longer a text file.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2014-01-13 Thread papukaija
This bug is fixed in Ubuntu 12.04 Precise Pangolin and newer (earlier
releases are no longer supported expect for some server releases). This
bug is only marked invalid for Ubuntu because it is unknown in which
release this bug was fixed. The fix released status for the non-Ubuntu
Gedit means that this bug is also fixed by Gedit's developers (Gnome).

There is no GUI option in Gedit itself, but you can use the Dconf Editor
which is fully graphical. You may need to install it first (eg. from the
Software Centre) if you cannot find it from your system's menus. Once
you have opened Dconf Editor, navigate to the
/org/gnome/gedit/preferences/editor folder and uncheck the "ensure-
trailing-newline" option. The default value for this option is checked;
ie. to add a new line to the file's end.

I hope this answers your questions. Please do not hesitate to ask for
further help or clarification about this bug. Thanks.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2014-01-12 Thread Vaclav Petras
Can someone clarify the status of this bug report? I can see Invalid &
Fix Released seems really strange and there is no explanation how it was
fixed (sorry, I'm not able to understand the proposed patches).

Is there any other way how to changed it except for:

  gsettings set org.gnome.gedit.preferences.editor ensure-trailing-
newline false

or its GUI equivalent? Is there a option in Gedit preferences for this,
so that it is visible to all users without searching online?  Was the
design decision reconsidered according the confusion it creates? See for
example:

http://stackoverflow.com/questions/3056740/gedit-adds-line-at-end-of-
page

Was the fact that that most of Gedit users are developers which want to
take care about these things them selves or see the current state in the
file?  What is the current default?

Thank you, I would say that explanations at the end of tickets avoids
opening duplicate tickets in the future.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2013-04-24 Thread Bug Watch Updater
** Changed in: gedit
   Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-10-21 Thread John Beatty
Thank you Ma Xiaojun, I shall have to upgrade.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-10-21 Thread papukaija
This bug report is being closed due to your last comment regarding this
being fixed with an update. For future reference you can manage the
status of your own bugs by clicking on the current status in the yellow
line and then choosing a new status in the revealed drop down box. You
can learn more about bug statuses at
https://wiki.ubuntu.com/Bugs/Status. Thank you again for taking the time
to report this bug and helping to make Ubuntu better. Please submit any
future bugs you may find.

** Changed in: gedit (Ubuntu)
   Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-10-20 Thread Ma Xiaojun
Hi, all.

If you are using 12.04 or 12.10 (other versions not tested), you can set
the behavior already.

1. Run dconf Editor (dconf-editor)
2. Go to /org/gnome/gedit/preferences/editor
3. Uncheck ensure-trailing-newline if you don't want automatically added 
newline.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-10-20 Thread John Beatty
I came across this bug while trying to understand bash. If I do

$ printf "%s$IFS" > out.txt

and look at out.txt in gedit, I am quite unaware that $IFS has the
newline character as its last character, because gedit thinks "aha, this
file already has a newline character as its last character, so I needn't
display it". Just to be sure I opened out.txt in hexedit before opening
it in gedit. I believe policy should be divorced from mechanism - if I
want a newline I should be able to add it myself; and have gedit show
whether it's there or not.

Incidentally, in 
Jesse van den Kieboom has provided a patch, but I'm not enough of a
linux guru to know how to apply it, and I don't see an entry for it in
gconf-editor.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-06-08 Thread Jails
I don't understand why this behavior is still imposed to the community. A 
simple option or plugin would allow everyone to enjoy gedit. the argument that 
"having an option for small similar details would rather confuse users than be 
useful ... gedit will stay simple to use for users" doesn't make sense for de 
following reasons :
- Silently adding a newline at the end of the file is not a "detail" for me.
- The Gedit syntax highlighting and features in general make it usefull for a 
wide audience and programmers too.
- Gedit has dozens of "expert" plugins but none can be done for this issue 
since the newline is always added at the end.

Users should have the choice to be able to configure Gedit to make it
save exactly what they write, no more no less.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-01-08 Thread Bug Watch Updater
** Changed in: gedit
   Status: Unknown => New

** Changed in: gedit
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-01-07 Thread papukaija
** Changed in: gedit
   Importance: Undecided => Unknown

** Changed in: gedit
   Status: New => Unknown

** Changed in: gedit
 Remote watch: None => GNOME Bug Tracker #625955

** Bug watch removed: GNOME Bug Tracker #95676
   https://bugzilla.gnome.org/show_bug.cgi?id=95676

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2012-01-07 Thread Matt Kantor
Sorry to bump this very old bug, but I found it very hard to find any
help on this issue, so I wanted to post some more information here.

An upstream bug covering this issue can be found at
.

@lowang:  That plugin does not resolve the issue.  It removes user-
placed whitespace, but not the magical hidden newline at the end of the
file.  Does a plugin exist which can do this?  Is such a thing even
possible, given how Gedit inserts it?

** Bug watch added: GNOME Bug Tracker #625955
   https://bugzilla.gnome.org/show_bug.cgi?id=625955

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/379367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 379367] Re: Gedit adding a newline at the end of file should be configurable

2010-12-20 Thread papukaija
** Summary changed:

- gedit add a newline at the end of file.I hope it can be config
+ Gedit adding a newline at the end of file should be configurable

** Description changed:

  Binary package hint: gedit
  
- gedit auto add a newline at the end of file.I hope it can be config
+ Ggedit auto adds a newline at the end of file.I hope it can be
+ configurable.
  
  I'm not a c/c++ developer, i'm php developer. but I use gedit for my php
- developing. gedit auto add a new line at the end of file, It's will
- cause a problem when my programm running. I hope this action can be
- config. thanks~!
+ developing. Gedit auto adds a new line at the end of file, which will
+ cause a problem when the program runs. I hope this action can be
+ configurable. thanks~!
  
  ProblemType: Bug
  Architecture: i386
  DistroRelease: Ubuntu 8.10
  ExecutablePath: /usr/bin/gedit
  Package: gedit 2.24.2-0ubuntu1
  ProcEnviron:
-  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
-  LANG=zh_CN.UTF-8
-  SHELL=/bin/bash
+  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+  LANG=zh_CN.UTF-8
+  SHELL=/bin/bash
  SourcePackage: gedit
  Uname: Linux 2.6.27-14-generic i686

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/379367

Title:
  Gedit adding a newline at the end of file should be configurable

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs