Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is happening:

Initially my cursor was at "initially here". When I press Ctrl+S to save the file my cursor automatically moves to the second position.

After many tries, I've seen that it randomly moves to a point one or two lines above the place where it initially was.

alt text

(The red line is the cursor - I've drawn it manually since it wont show up in printscreen)

Did anyone notice this thing?

My version of Notepad is:

alt text

It is a problem since I keep typing and whenever I save, I have to manually bring the cursor down to the correct place or else I am typing somewhere between the lines!

share|improve this question
1  
I'm guessing there should be some images in the post but it only shows "alt text" for me. –  T. Kaltnekar Oct 19 '09 at 6:29
    
@T. Kaltnekar Is it fixed now? –  Lazer Oct 19 '09 at 6:32
    
Yes, images are visible now. –  T. Kaltnekar Oct 19 '09 at 6:40
    
@T. Kaltnekar thanks. –  Lazer Oct 19 '09 at 6:53
1  
From test I did - if I added a few chars and saved it didn't move. If I added enough text so it wrapped at end of line cursor moved after saving. More times it wrapped the more it moved. –  T. Kaltnekar Oct 19 '09 at 7:17

3 Answers 3

up vote 14 down vote accepted

I noticed this problem in Windows XP Notepad. It only happens if word wrap is on when you save. The amount the cursor moves back is related to the number of new wrap points before the cursor since the last save. The more new wrap points before the cursor, the further the cursor moves back.

Why does the cursor move? When you save with word wrap on, Notepad inserts CR CR LF characters at each wrap point in the display window (but not in the saved file). The number of characters from the beginning of the display window to the cursor stays the same, but because of the extra CR CR LF characters, the cursor appears to move backward.

For more information and a step-by-step example, see Notepad bug: Saving with word wrap on inserts CR CR LF characters in the display window.

share|improve this answer
1  
thanks for adding info. posts consisting primarily of a link are discouraged here to minimize future problems with broken links. –  quack quixote Feb 17 '10 at 4:25
    
the answer I was waiting for! –  Lazer Feb 17 '10 at 5:00

Regardless of whether this is a bug, if you are doing anything in notepad regularly enough for this to be an issue, you need to start using a better text editor. Try the free notepad++ for a start - http://notepad-plus.sourceforge.net/

share|improve this answer
1  
I have had... issues with Notepad++ crashing and/or hanging on file open on multiple systems quite often. Other than that, a great editor ;) –  Ed S. Oct 19 '09 at 8:04
    
see SO for a list of popular text editors: stackoverflow.com/questions/14155/windows-based-text-editors –  lexu Oct 19 '09 at 8:35

Open your Registry editor, and in Current User locate the following key:

HKEY_CURRENT_USER\Software\Microsoft\Notepad

then

  1. Create a new DWORD value called fSavePageSettings and set it to "1"
  2. if fSaveWindowPositions doesn't exist then Create DWORD and set it to "1"
share|improve this answer
2  
What do these keys mean and what is their effect? –  Oliver Salzburg Aug 15 '12 at 16:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.