Live data from Hacker News

Bug in Notepad Involving Asterisk in Title Bar

suszter.com

41–50 of 132 posts

Re: Bug in Notepad Involving Asterisk in Title Bar

#41
There's a bug in notepad that lets you turn your computer into a marquee. Making the text big and turning off wordwrap causes the text rendering to lag behind your typing. Here is a demo video I threw together. It's good to have in your pocket for if you're ever bored at fry's or something, that said the update speed is a bit jarring.

https://www.youtube.com/watch?v=w-Y9oeCWeGc

Re: Bug in Notepad Involving Asterisk in Title Bar

#42

What a feature to introduce in 2020. This has been a core part of the UI of OS X for… ever? For every app.

macOS is using "dot on top of the Close button", to indicate both that there are unsaved changes, and that if you tried to close the window, you would get a prompt asking about unsaved changes.

Simpler, more elegant, better integrated solution, consistent across the whole OS.

"Asterisk in the Title Bar" is a very unrefined solution to the problem.

Re: Bug in Notepad Involving Asterisk in Title Bar

#43

Do you still get a dialog asking to save when you close a modified file when the title bar shows no asterisk?

Yeah, I played around with this a little bit. It seems like Notepad knows the document has been changed, the bug is purely that the title bar isn't updated in this one case.

Which actually seems all the more odd because it does get updated when you move the mouse, use the arrow keys (or other non-inserting keys like Alt+F4)

Re: Bug in Notepad Involving Asterisk in Title Bar

#44
post #11

For how long has this bug been live? It blows my mind that no one noticed this sooner

Blows my mind that people actually care about this bug.

Lets see if I can blew you mind even more:

Today I found a bug in the editor of the Commodore 64. It has been there for at least 30 years.

Re: Bug in Notepad Involving Asterisk in Title Bar

#45
post #9

Earlier quoted context omitted.

Pressing the arrow keys on their own does nothing, but pressing DEL (no title update) then an arrow key does.

Huh (confirmed), trying to imagine that code path. Edit: Played around a bit, it's odd. For example then click on a different window (release focus) does trigger the update.

Just looking at the messages received, it looks like they're triggering off a few different things to fall into the code path that looks for changes (the missing numbers are due to me deleting uninteresting messages):

     002A1272 P WM_KEYDOWN nVirtKey:VK_DELETE cRepeat:1 ScanCode:53 fExtended:1 fAltDown:0 fRepeat:0 fUp:0
     002A1272 S EM_POSFROMCHAR wCharIndex:0
     004E0A18 S WM_COMMAND wNotifyCode:EN_CHANGE wID:15 hwndCtl:002A1272
     002A1272 P WM_KEYUP nVirtKey:VK_DELETE cRepeat:1 ScanCode:53 fExtended:1 fAltDown:0 fRepeat:1 fUp:1
     002A1272 P WM_KEYDOWN nVirtKey:VK_RIGHT cRepeat:1 ScanCode:4D fExtended:1 fAltDown:0 fRepeat:0 fUp:0
     002A1272 S EM_POSFROMCHAR wCharIndex:1
     002A1272 S EM_GETMODIFY
     004E0A18 S WM_SETTEXT lpsz:02EDCAF8 ("*Example.txt- Notepad")
The one that seems to get triggered the most, indeed the one triggering it here, is the code path that also updates the position indicator, hence why Del isn't doing anything. Interestingly enough, they seem to be ignoring the EN_CHANGE message, and instead looking for changes explicitly after some events. Given the long history of Notepad, I'm sure there's some historical reason for that.

They do seem to be covering the bases checking for changes before anything that might lose data, like any path I can find to close the window, so it's a minor bug. They also check for changes on each and every mouse move message, so I think for most users, this state won't last long.

Re: Bug in Notepad Involving Asterisk in Title Bar

#47

not asking to get into an app namedropping war, but do alot of ppl use Notepad still? Kind of moved away from it years ago due to encoding, lack of some features etc

Repeat: I am not asking what you use alternatively. Just commenting on perceived decline in anyone actually using Notepad

Re: Bug in Notepad Involving Asterisk in Title Bar

#48

not asking to get into an app namedropping war, but do alot of ppl use Notepad still? Kind of moved away from it years ago due to encoding, lack of some features etc

Pretty sure tons of people use it still. It's the built-in editor, so while it's not a good code editor by any stretch of the imagination, it's infinitely useful for people who are not coding, who don't have some other editor or text processor installed.

Re: Bug in Notepad Involving Asterisk in Title Bar

#49

not asking to get into an app namedropping war, but do alot of ppl use Notepad still? Kind of moved away from it years ago due to encoding, lack of some features etc

Any app that’s installed by default is always used by large numbers of users. Even if not for real text editing, plenty of people use it just as a temporary place to paste copied text to strip the formatting before copy/pasting it somewhere else.

Re: Bug in Notepad Involving Asterisk in Title Bar

#50
post #9

Earlier quoted context omitted.

Huh (confirmed), trying to imagine that code path. Edit: Played around a bit, it's odd. For example then click on a different window (release focus) does trigger the update.

if(key !== KEY_DELETE) { testForChanges(); }

probably a range on the numerical index of the keys, non?
Post reply on HN