Bug in Notepad Involving Asterisk in Title Bar

Posted | Modified

Back in May 27, 2020 Microsoft published a blog post describing a new feature in Notepad:

when you see an asterisk in the title bar you’ll know you have unsaved changes

I’m using Windows 10 20H2 (OS Build 19042.928) and most of the time this feature works as described. For example, when you open a text document in Notepad and change the text, an asterisk appears in the title bar to indicate there are unsaved changes.

However, when you open a text document and change the text by using the Delete key to delete the character ahead of the cursor, the asterisk does not appear in the title bar. If you delete the character using the Backspace the asterisk appears though.

Notepad adds the asterisk to the title bar via the notepad!UpdateTitle function. This function is not being called when pressing the Delete key. However, it is being called when pressing other keys, for example, the Backspace key.

notepad!UpdateTitle can be triggered by keys that do not edit text, for example by pressing the the arrow keys. When you press Delete key the asterisk does not appear, but when you press an arrow key afterwards the asterisk in the title bar now does appear.