TransWikia.com

Why does Windows Vista's Notepad randomly move the cursor after saving a file?

Super User Asked by Lazer on January 12, 2021

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!

5 Answers

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.

Correct answer by Bavi_H on January 12, 2021

Workaround:

Since MS hired 166,000 employee to make sure these bugs won't be fixed for eternity, I made my own workaround for it. I use "Hot Keyboard" to fix all sort of things including this one. Make a macro like this, condition it to run only on Notepad and assign ctrl+s to it:

  1. Type some rare character like *
  2. Press ctrl+s
  3. Press home in case cursor doesn't move back
  4. Press ctrl+f , type * , enter & esc .
    Now the cursor is back where it was and you can delete that * character.
  5. Press delete

P.S, Unlike AutoHotkey, You don't need any coding with Hot Keyboard just record what you do with mouse/keyboard. When you set the speed of macro to 100X or max you won't notice any of those things happen and it seems like always when you save with ctrl+s except without that annoying moving cursor thing.

enter image description here

Answered by dashakol on January 12, 2021

(Can't post as a comment because I don't have enough reputation.)

According to this site, it was fixed by at least Windows 10 version 1511 (November 2015).

According to this site, the bug existed in Windows 10 on October 18 2015.

If we're going by major versions of Windows 10, the initial release was 1507, then the next major version was 1511. So by deduction, version 1511 was the first major update that had this bug fixed.

Answered by user868538 on January 12, 2021

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

HKEY_CURRENT_USERSoftwareMicrosoftNotepad

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"

Answered by jama.jamazoka on January 12, 2021

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/

Answered by micmcg on January 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP