nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Line endings


From: Roland Glenn McIntosh
Subject: [Nano-devel] Line endings
Date: Wed, 26 Jan 2005 14:05:41 -0500
User-agent: Mozilla Thunderbird 0.6 (Windows/20040502)

Currently Nano is pretty dumb about line endings, compared to vim. I would very much like to see a feature to preserve original line endings with logic similar to this:

1) if a file is all CRLR, open it as DOS and save it as DOS. Do not show ^M characters. put "DOS" in the status line or similar notice.
   2) if a file is all CR, open it as Unix and save it as Unix.
   3) if a file has both CR and CRLF, assume unix.  Show ^M chars.

I'm running nano 1.2.4 which I compiled myself on the latest Cygwin, using ncurses. I was trying to recommend it to a friend to edit his /cygdrive/c/windows/system32/drivers/etc/hosts file, but even though set noconvert was in my .nanorc, after saving it got saved with both CR and CRLF terminators. The ^Ms are really ugly too.

I'm fully aware that you can use M-D when saving to direct nano to save in DOS format, however this extra step is beyond what I can expect my users to remember. From their perspective they edited the hosts file, saw some ugly ^M characters, added a line, saved it, and now it "won't work right" in Windows Notepad (mixed line endings).

Nano works beautifully in mostly-unix file environments. I'd love to be able to recommend this editor under Windows platforms, if only it "did the right thing" with respect to line endings.

Thank you.
-Roland McIntosh





reply via email to

[Prev in Thread] Current Thread [Next in Thread]