Barry said:
I was the bug reporter in the other thread. I _have_ tried it.
To reproduce it:
1. Open
http://www.polisource.com/misc/notepad-bug.txt in Notepad,
with
"word wrap" checked, when the Notepad window isn't full-screen size
(mine is
about half the size of my monitor), then maximize Notepad so it's
full-screen
size and you'll see the text spread out to fit the width of the
screen. (this
step is just to show that the line is a single line that wraps as
such).
2. Make the screen smaller again and save the file, then maximize
again, and
you'll see that the text won't be spread out.
This shows that the document on the screen changes when it's saved.
Line
breaks are added.
That is merely a formatting issue regarding line-wrap mode. When you
reduce the size of the window, Notepad breaks the long line at word
boundaries. When you maximize the window, Notepad doesn't know how to
repaste the lines back together - but that is ONLY in its *view*
inside the window. When you maximize but the word wrap doesn't
repaste the lines together, save the file while it looks like the
lines are truncated. Two things happen: as soon as you do the save,
Notepad displays the saved file and word wrapping uses the full width
of each line in the maximized window; and, when you open the saved
file, you'll see there was no truncation.
Notepad knows how to perform line wrapping when the window is reduced
in size. It doesn't know how to do UNWRAPPING when the window is
enlarged. Notepad is not a WYSIWYG editor with all of those features.
Don't expect line wrapping to magically UNWRAP a line when you enlarge
a view of a document by increasing the window size in Notepad. No
linebreaks got added to the saved file. Just because YOU see
whitespace inside of Notepad's window doesn't mean it is there in the
file.
Just turn off word wrap and turn it back on. Voila, now the line that
got elongated in the 1-line view with word wrap off will get
automatically parsed when you turn word wrap back on. Notepad only
does line wrapping when the window is reduced in size if a view has
been captured, like when doing the save. It tries to do the line
wrapping otherwise but it is JUST A SIMPLE PLAIN-TEXT EDITOR, not a
word processor.
There are other text file editors that do better on the line wrapping.
Some even add so many features that eventually they become more like
word processing programs. Some are just very potent text editors,
like VIM. Of course, if all you want is a very simple line editor,
you could use edlin.exe. It still exists (well, up to Windows XP).